]> git.baikalelectronics.ru Git - kernel.git/commit
gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 10 Jun 2015 13:05:05 +0000 (16:05 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 11 Jun 2015 08:17:32 +0000 (10:17 +0200)
commit870d923dfea122bff376a9b004f23421e2d8c4e8
tree89ba98840b4d1afcc131f479225a54d2f624d517
parentc83c2eb3c65838fd5a54d96186981555a9f18729
gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found

If a driver requests a GPIO described in its _CRS but the GPIO host
controller (gpiochip) driver providing the GPIO has not been loaded yet
acpi_get_gpiod() returns -ENODEV which causes the calling driver to fail.

If the gpiochip driver is loaded afterwards the driver requesting the GPIO
will not notice this.

Better approach is to return -EPROBE_DEFER in such case. Then when the
gpiochip driver appears the driver requesting the GPIO will be probed
again. This also aligns ACPI GPIO lookup code closer to DT as it does
pretty much the same when no gpiochip driver was found.

Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Reviewed-by: Amos Kong <kongjianjun@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-acpi.c