mtd: m25p80: assign default read command

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 28 00:59:07 EST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=99ed1a167578f85963a0cdf5fd7b2291eaecc400
Commit:     99ed1a167578f85963a0cdf5fd7b2291eaecc400
Parent:     973b88fbfa265788f01e65c8667604bf582d5961
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Wed Dec 4 22:59:40 2013 -0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Jan 20 11:49:48 2014 -0800

    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.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Cc: Sourav Poddar <sourav.poddar at ti.com>
    Acked-by: Marek Vasut <marex at denx.de>
---
 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 19632e3..d0f6475 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;



More information about the linux-mtd-cvs mailing list