]> git.ipfire.org Git - people/ms/linux.git/commitdiff
SPI/MTD: mtd_dataflash oops prevention
authorDavid Brownell <dbrownell@users.sourceforge.net>
Sat, 6 Jan 2007 00:08:47 +0000 (01:08 +0100)
committerAdrian Bunk <bunk@stusta.de>
Tue, 9 Jan 2007 02:23:31 +0000 (03:23 +0100)
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>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/mtd/devices/mtd_dataflash.c

index a19480d07888dfd043872b2e5d715755851a17e8..dabffa280dd4cc5378b3c57296c73928830aa720 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;
        }