Skip to contentSkip to conversation

mtd: m25p80: assign default read command

PATCH In review Brian Norris 2 participants 3 messages Jan 16, 2014 – Jan 20, 2014 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: m25p80: assign default read command

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.

---
 drivers/mtd/devices/m25p80.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/devices/m25p80.c +2 -0
index 19632e330d36..d0f6475504f5 100644
@@ -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;
Signature · 1 line
1.8.3.2
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · 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...).

Yep, that's true. It did default to the correct _NORMAL.

Quoted 4 lines

Fix this by setting a default for the 'else' clause.

Let's be explicit indeed.

Best regards,
Marek Vasut

#2 lore raw
Quoted 14 lines · Marek Vasut
Quoted 10 lines · 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...).

Yep, that's true. It did default to the correct _NORMAL.

Quoted 8 lines
Quoted 4 lines

Fix this by setting a default for the 'else' clause.

Let's be explicit indeed.

Thanks. Pushed to l2-mtd.git.

Brian