From de4fa99266b2e1f6771644b9b50f33fe8f82d728 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 29 Dec 2006 16:48:47 -0800 Subject: [PATCH] [PATCH] SPI/MTD: mtd_dataflash oops prevention Return a fault code if the Dataflash driver runs into a "no device present" error when the MISO line has a pulldown (it currently expects a pullup), so that rmmod won't oops. Signed-off-by: David Brownell Cc: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mtd/devices/mtd_dataflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 0a7e86859bf..910e4061dfd 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -536,7 +536,7 @@ static int __devinit dataflash_probe(struct spi_device *spi) if (status <= 0 || status == 0xff) { DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", spi->dev.bus_id, status); - if (status == 0xff) + if (status == 0 || status == 0xff) status = -ENODEV; return status; } -- 2.20.1