mtd: m25p80: Use positive logic to check JEDEC ID

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Apr 5 02:59:01 EDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b2fda1296bb8e213a6bad3937326ae98c4c4773c
Commit:     b2fda1296bb8e213a6bad3937326ae98c4c4773c
Parent:     bd9c6e99b58255b9de1982711ac9487c9a2f18be
Author:     Axel Lin <axel.lin at ingics.com>
AuthorDate: Tue Jan 21 15:56:34 2014 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 10 22:42:23 2014 -0700

    mtd: m25p80: Use positive logic to check JEDEC ID
    
    For slightly better readability.
    
    Signed-off-by: Axel Lin <axel.lin at ingics.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/devices/m25p80.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 1e147a8..c6e6d8e 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -1078,9 +1078,8 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi)
 	for (tmp = 0; tmp < ARRAY_SIZE(m25p_ids) - 1; tmp++) {
 		info = (void *)m25p_ids[tmp].driver_data;
 		if (info->jedec_id == jedec) {
-			if (info->ext_id != 0 && info->ext_id != ext_jedec)
-				continue;
-			return &m25p_ids[tmp];
+			if (info->ext_id == 0 || info->ext_id == ext_jedec)
+				return &m25p_ids[tmp];
 		}
 	}
 	dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec);



More information about the linux-mtd-cvs mailing list