From: Roland Stigge Date: Wed, 27 Jun 2012 15:51:15 +0000 (+0200) Subject: mtd: lpc32xx_slc: Make probe() return -EPROBE_DEFER if necessary X-Git-Tag: v3.7-rc1~70^2~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5842ab730d368ae2e8925dc00aec0ca132b72ab;p=platform%2Fkernel%2Flinux-stable.git mtd: lpc32xx_slc: Make probe() return -EPROBE_DEFER if necessary 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 Acked-by: Alexandre Pereira da Silva Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c index 1166650..1719387 100644 --- a/drivers/mtd/nand/lpc32xx_slc.c +++ b/drivers/mtd/nand/lpc32xx_slc.c @@ -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");