* [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase
@ 2015-10-07 19:52 Heiner Kallweit
2015-11-20 23:28 ` Brian Norris
0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2015-10-07 19:52 UTC (permalink / raw)
To: Brian Norris; +Cc: linux-mtd
Return an error if spi_write fails.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/mtd/devices/m25p80.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 634b0c4..f10daa8 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
flash->command[0] = nor->erase_opcode;
m25p_addr2cmd(nor, offset, flash->command);
- spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
-
- return 0;
+ return spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
}
/*
--
2.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase
2015-10-07 19:52 [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase Heiner Kallweit
@ 2015-11-20 23:28 ` Brian Norris
2015-11-29 11:18 ` Michal Suchanek
0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2015-11-20 23:28 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: linux-mtd
On Wed, Oct 07, 2015 at 09:52:45PM +0200, Heiner Kallweit wrote:
> Return an error if spi_write fails.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/mtd/devices/m25p80.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 634b0c4..f10daa8 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
> flash->command[0] = nor->erase_opcode;
> m25p_addr2cmd(nor, offset, flash->command);
>
> - spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
> -
> - return 0;
> + return spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
> }
>
> /*
m25p80_erase() has been dropped, as it can be implemented in spi-nor.c,
with calls only to ->write_reg(). This error handling is done correctly
there. See:
cd78ea02dc82 ("mtd: m25p80: drop erase() callback")
c67cbb839da9 ("mtd: spi-nor: provide default erase_sector implementation")
Brian
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase
2015-11-20 23:28 ` Brian Norris
@ 2015-11-29 11:18 ` Michal Suchanek
2015-11-29 11:34 ` Ezequiel Garcia
0 siblings, 1 reply; 5+ messages in thread
From: Michal Suchanek @ 2015-11-29 11:18 UTC (permalink / raw)
To: Brian Norris; +Cc: Heiner Kallweit, MTD Maling List
Hello,
On 21 November 2015 at 00:28, Brian Norris <computersforpeace@gmail.com> wrote:
> On Wed, Oct 07, 2015 at 09:52:45PM +0200, Heiner Kallweit wrote:
>> Return an error if spi_write fails.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> drivers/mtd/devices/m25p80.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index 634b0c4..f10daa8 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
>> flash->command[0] = nor->erase_opcode;
>> m25p_addr2cmd(nor, offset, flash->command);
>>
>> - spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>> -
>> - return 0;
>> + return spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>> }
>>
>> /*
>
> m25p80_erase() has been dropped, as it can be implemented in spi-nor.c,
> with calls only to ->write_reg(). This error handling is done correctly
> there. See:
>
> cd78ea02dc82 ("mtd: m25p80: drop erase() callback")
> c67cbb839da9 ("mtd: spi-nor: provide default erase_sector implementation")
>
Where are these patches applied?
I wrote exact same patch as above and it still applies to Linux master.
Thanks
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase
2015-11-29 11:18 ` Michal Suchanek
@ 2015-11-29 11:34 ` Ezequiel Garcia
2015-11-29 13:15 ` Michal Suchanek
0 siblings, 1 reply; 5+ messages in thread
From: Ezequiel Garcia @ 2015-11-29 11:34 UTC (permalink / raw)
To: Michal Suchanek; +Cc: Brian Norris, MTD Maling List, Heiner Kallweit
On 29 November 2015 at 08:18, Michal Suchanek <hramrach@gmail.com> wrote:
> Hello,
>
> On 21 November 2015 at 00:28, Brian Norris <computersforpeace@gmail.com> wrote:
>> On Wed, Oct 07, 2015 at 09:52:45PM +0200, Heiner Kallweit wrote:
>>> Return an error if spi_write fails.
>>>
>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>> ---
>>> drivers/mtd/devices/m25p80.c | 4 +---
>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>>> index 634b0c4..f10daa8 100644
>>> --- a/drivers/mtd/devices/m25p80.c
>>> +++ b/drivers/mtd/devices/m25p80.c
>>> @@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
>>> flash->command[0] = nor->erase_opcode;
>>> m25p_addr2cmd(nor, offset, flash->command);
>>>
>>> - spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>>> -
>>> - return 0;
>>> + return spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>>> }
>>>
>>> /*
>>
>> m25p80_erase() has been dropped, as it can be implemented in spi-nor.c,
>> with calls only to ->write_reg(). This error handling is done correctly
>> there. See:
>>
>> cd78ea02dc82 ("mtd: m25p80: drop erase() callback")
>> c67cbb839da9 ("mtd: spi-nor: provide default erase_sector implementation")
>>
>
> Where are these patches applied?
>
As per [1] latest MTD patches are in http://git.infradead.org/l2-mtd.git.
[1] http://www.linux-mtd.infradead.org/source.html
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase
2015-11-29 11:34 ` Ezequiel Garcia
@ 2015-11-29 13:15 ` Michal Suchanek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Suchanek @ 2015-11-29 13:15 UTC (permalink / raw)
To: Ezequiel Garcia; +Cc: Brian Norris, MTD Maling List, Heiner Kallweit
On 29 November 2015 at 12:34, Ezequiel Garcia
<ezequiel@vanguardiasur.com.ar> wrote:
> On 29 November 2015 at 08:18, Michal Suchanek <hramrach@gmail.com> wrote:
>> Hello,
>>
>> On 21 November 2015 at 00:28, Brian Norris <computersforpeace@gmail.com> wrote:
>>> On Wed, Oct 07, 2015 at 09:52:45PM +0200, Heiner Kallweit wrote:
>>>> Return an error if spi_write fails.
>>>>
>>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>>> ---
>>>> drivers/mtd/devices/m25p80.c | 4 +---
>>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>>>> index 634b0c4..f10daa8 100644
>>>> --- a/drivers/mtd/devices/m25p80.c
>>>> +++ b/drivers/mtd/devices/m25p80.c
>>>> @@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
>>>> flash->command[0] = nor->erase_opcode;
>>>> m25p_addr2cmd(nor, offset, flash->command);
>>>>
>>>> - spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>>>> -
>>>> - return 0;
>>>> + return spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>>>> }
>>>>
>>>> /*
>>>
>>> m25p80_erase() has been dropped, as it can be implemented in spi-nor.c,
>>> with calls only to ->write_reg(). This error handling is done correctly
>>> there. See:
>>>
>>> cd78ea02dc82 ("mtd: m25p80: drop erase() callback")
>>> c67cbb839da9 ("mtd: spi-nor: provide default erase_sector implementation")
>>>
>>
>> Where are these patches applied?
>>
>
> As per [1] latest MTD patches are in http://git.infradead.org/l2-mtd.git.
>
> [1] http://www.linux-mtd.infradead.org/source.html
>
Yes, that has those patches.
Thanks
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-29 13:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 19:52 [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase Heiner Kallweit
2015-11-20 23:28 ` Brian Norris
2015-11-29 11:18 ` Michal Suchanek
2015-11-29 11:34 ` Ezequiel Garcia
2015-11-29 13:15 ` Michal Suchanek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).