Skip to contentSkip to conversation

mtd: spi-nor: use IS_ERR_OR_NULL as spi_nor_read_id returns ERR_PTR

PATCH In review Rafał Miłecki 2 participants 2 messages Dec 1, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi-nor: use IS_ERR_OR_NULL as spi_nor_read_id returns ERR_PTR

---
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(-)
drivers/mtd/spi-nor/spi-nor.c +1 -1
index afc58da..0f8ec3c 100644
@@ -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;
Signature · 1 line
1.8.4.5
#1 lore raw
Quoted 7 lines · Rafał Miłecki

---
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.

Squashed into the bad commit and pushed to l2-mtd.git. Thanks!