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: NTobias Diedrich <tobiasdiedrich@gmail.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: NTobias Diedrich <ranma+kernel@tdiedrich.de> Reviewed-by:Amos Kong <kongjianjun@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Showing
想要评论请 注册 或 登录