[PATCH] mtd: spi-nor: use IS_ERR_OR_NULL as spi_nor_read_id returns ERR_PTR

Rafał Miłecki zajec5 at gmail.com
Mon Dec 1 02:37:24 PST 2014


Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
---
Oh damn, I did wrong in my commit
5986a0d4717bc82af0e69e3c6dd04150eafceabe
mtd: spi-nor: allow NULL as chip name and try to auto detect it

Glad we have Dan & kbuild watching us.
---
 drivers/mtd/spi-nor/spi-nor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index afc58da..0f8ec3c 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -943,7 +943,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
 		id = spi_nor_read_id(nor);
 	else
 		id = spi_nor_match_id(name);
-	if (!id)
+	if (IS_ERR_OR_NULL(id))
 		return -ENOENT;
 
 	info = (void *)id->driver_data;
-- 
1.8.4.5




More information about the linux-mtd mailing list