lkml.org 
[lkml]   [2019]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 09/22] mtd: spi-nor: Fix retlen handling in sst_write()
Date


On 10/10/2019 10:33 AM, Boris Brezillon wrote:

>> drivers/mtd/spi-nor/spi-nor.c | 22 +++++++++++-----------
>> 1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
>> index 0aee068a5835..be5dee622d51 100644
>> --- a/drivers/mtd/spi-nor/spi-nor.c
>> +++ b/drivers/mtd/spi-nor/spi-nor.c
>> @@ -2665,12 +2665,12 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
>> /* write one byte. */
>> ret = spi_nor_write_data(nor, to, 1, buf);
>> if (ret < 0)
>> - goto sst_write_err;
>> + goto unlock_and_unprep;
>> WARN(ret != 1, "While writing 1 byte written %i bytes\n",
>> (int)ret);
>> ret = spi_nor_wait_till_ready(nor);
>> if (ret)
>> - goto sst_write_err;
>> + goto unlock_and_unprep;
>> }
>> to += actual;
> Not sure we need this new label, we can just have:
>
> actual = 0;
> /* Start write from odd address. */
> if (to % 2) {
> nor->program_opcode = SPINOR_OP_BP;
>
> /* write one byte. */
> ret = spi_nor_write_data(nor, to, 1, buf);
> if (ret < 0)
> goto out;
> WARN(ret != 1, "While writing 1 byte written %i
> bytes\n", (int)ret);
> ret = spi_nor_wait_till_ready(nor);
> if (ret)
> goto out;
>
> to++;
> actual++;
> }
>

nice, thanks!
\
 
 \ /
  Last update: 2019-10-25 09:35    [W:0.054 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site