diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2015-07-14 10:29:54 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-07-28 13:55:36 +0200 |
commit | 28355f81969962cf01aef5b13d7de5b4ab0c5f13 (patch) | |
tree | d2f124df65cc05d337ddf3958c6263c021c3eb2a /drivers/gpio/gpiolib.c | |
parent | 23393d49fb75ca97b179668aa86b7038c2dc0831 (diff) | |
download | op-kernel-dev-28355f81969962cf01aef5b13d7de5b4ab0c5f13.zip op-kernel-dev-28355f81969962cf01aef5b13d7de5b4ab0c5f13.tar.gz |
gpio: defer probe if pinctrl cannot be found
When an OF node has a pin range for its GPIOs, return -EPROBE_DEFER if
the pin controller isn't available.
Otherwise, the GPIO range wouldn't be set at all unless the pin
controller probed always before the GPIO chip.
With this change, the probe of the GPIO chip will be deferred and will
be retried at a later point, hopefully once the pin controller has been
registered and probed already.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 9312bbc..1b5b8da 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -290,7 +290,10 @@ int gpiochip_add(struct gpio_chip *chip) if (!chip->owner && chip->dev && chip->dev->driver) chip->owner = chip->dev->driver->owner; - of_gpiochip_add(chip); + status = of_gpiochip_add(chip); + if (status) + goto err_remove_chip; + acpi_gpiochip_add(chip); status = gpiochip_sysfs_register(chip); |