[PATCH] SPI/MTD: mtd_dataflash oops prevention
authorDavid Brownell <david-b@pacbell.net>
Sat, 30 Dec 2006 00:48:47 +0000 (16:48 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sat, 30 Dec 2006 18:56:42 +0000 (10:56 -0800)
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 <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/mtd/devices/mtd_dataflash.c

index 0a7e86859bf10677de7d3bc4227d84ed098303ba..910e4061dfd231dd31a5c1c97bf7d3f8d6c41f71 100644 (file)
@@ -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;
        }