Re: [PATCH] gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found

From: Linus Walleij
Date: Thu Jun 11 2015 - 04:18:46 EST


On Wed, Jun 10, 2015 at 3:05 PM, Mika Westerberg
<mika.westerberg@xxxxxxxxxxxxxxx> wrote:

> 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@xxxxxxxxx>
> Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>

Patch applied with the ACKs etc.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/