]> Pileus Git - ~andy/linux/commitdiff
mtd: lpc32xx_slc: Make probe() return -EPROBE_DEFER if necessary
authorRoland Stigge <stigge@antcom.de>
Wed, 27 Jun 2012 15:51:15 +0000 (17:51 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 6 Jul 2012 17:25:25 +0000 (18:25 +0100)
Via of_get_named_gpio(), wp_gpio can become -EPROBE_DEFER which now makes
probe() return -EPROBE_DEFER as well to wait until the gpio controller is
probed before trying to probe lpc32xx_slc again.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/lpc32xx_slc.c

index 116665015269d5b7f41655488235c93b6a59db8d..1719387dd008a62b8dbc0c223e98d559d8b98ff1 100644 (file)
@@ -821,6 +821,8 @@ static int __devinit lpc32xx_nand_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "Missing platform data\n");
                return -ENOENT;
        }
+       if (host->ncfg->wp_gpio == -EPROBE_DEFER)
+               return -EPROBE_DEFER;
        if (gpio_is_valid(host->ncfg->wp_gpio) &&
                        gpio_request(host->ncfg->wp_gpio, "NAND WP")) {
                dev_err(&pdev->dev, "GPIO not available\n");