* [PATCH] mtd: m25p80: assign default read command
@ 2014-01-16 21:09 Brian Norris
2014-01-18 18:54 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2014-01-16 21:09 UTC (permalink / raw)
To: linux-mtd; +Cc: Marek Vasut, Sourav Poddar, Brian Norris
In the following commit (in -next):
commit 8552b439aba7f32063755d23f79ca27b4d0a3115
drivers: mtd: m25p80: convert "bool" read check into an enum
We converted the boolean 'fast_read' property to become an enum
'flash_read', but at the same time, we changed the conditional path so
that it doesn't choose a default value in some cases (technically, we
choose the correct default simply by virtue of devm_kzalloc(), which
zeroes this out to be a NORMAL read operation, but still...).
Fix this by setting a default for the 'else' clause.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
---
drivers/mtd/devices/m25p80.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 19632e330d36..d0f6475504f5 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -1204,6 +1204,8 @@ static int m25p_probe(struct spi_device *spi)
/* If we were instantiated by DT, use it */
if (of_property_read_bool(np, "m25p,fast-read"))
flash->flash_read = M25P80_FAST;
+ else
+ flash->flash_read = M25P80_NORMAL;
} else {
/* If we weren't instantiated by DT, default to fast-read */
flash->flash_read = M25P80_FAST;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] mtd: m25p80: assign default read command
2014-01-16 21:09 [PATCH] mtd: m25p80: assign default read command Brian Norris
@ 2014-01-18 18:54 ` Marek Vasut
2014-01-20 19:51 ` Brian Norris
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2014-01-18 18:54 UTC (permalink / raw)
To: Brian Norris; +Cc: Sourav Poddar, linux-mtd
On Thursday, January 16, 2014 at 10:09:07 PM, Brian Norris wrote:
> In the following commit (in -next):
>
> commit 8552b439aba7f32063755d23f79ca27b4d0a3115
> drivers: mtd: m25p80: convert "bool" read check into an enum
>
> We converted the boolean 'fast_read' property to become an enum
> 'flash_read', but at the same time, we changed the conditional path so
> that it doesn't choose a default value in some cases (technically, we
> choose the correct default simply by virtue of devm_kzalloc(), which
> zeroes this out to be a NORMAL read operation, but still...).
Yep, that's true. It did default to the correct _NORMAL.
> Fix this by setting a default for the 'else' clause.
>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Sourav Poddar <sourav.poddar@ti.com>
Let's be explicit indeed.
Acked-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: m25p80: assign default read command
2014-01-18 18:54 ` Marek Vasut
@ 2014-01-20 19:51 ` Brian Norris
0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2014-01-20 19:51 UTC (permalink / raw)
To: Marek Vasut; +Cc: Sourav Poddar, linux-mtd
On Sat, Jan 18, 2014 at 07:54:40PM +0100, Marek Vasut wrote:
> On Thursday, January 16, 2014 at 10:09:07 PM, Brian Norris wrote:
> > In the following commit (in -next):
> >
> > commit 8552b439aba7f32063755d23f79ca27b4d0a3115
> > drivers: mtd: m25p80: convert "bool" read check into an enum
> >
> > We converted the boolean 'fast_read' property to become an enum
> > 'flash_read', but at the same time, we changed the conditional path so
> > that it doesn't choose a default value in some cases (technically, we
> > choose the correct default simply by virtue of devm_kzalloc(), which
> > zeroes this out to be a NORMAL read operation, but still...).
>
> Yep, that's true. It did default to the correct _NORMAL.
>
> > Fix this by setting a default for the 'else' clause.
> >
> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > Cc: Sourav Poddar <sourav.poddar@ti.com>
>
> Let's be explicit indeed.
>
> Acked-by: Marek Vasut <marex@denx.de>
Thanks. Pushed to l2-mtd.git.
Brian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-20 19:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 21:09 [PATCH] mtd: m25p80: assign default read command Brian Norris
2014-01-18 18:54 ` Marek Vasut
2014-01-20 19:51 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox