[PATCH] reset: core: reset-gpio: Suppress registration error for optional resets
Philipp Zabel
p.zabel at pengutronix.de
Mon Oct 6 06:09:23 PDT 2025
Hi Andre,
On Do, 2025-10-02 at 23:28 +0100, Andre Przywara wrote:
> For reset controllers that are marked as optional, we should skip errors
> during probing and return NULL, to avoid unnecessary failures. The
> reset-gpio controller does this mostly, but returns the true error in
> case the __reset_add_reset_gpio_device() call fails. Treat this call the
> same as the other registration errors, and consider the optional flag.
>
> One could argue that at this point it's a proper error that should not
> be ignored anymore, but in case of the reset-gpio controller this is not
> entirely true, since the code at the moment does not support GPIO
> controllers with three #gpio-cells - there is a TODO comment about this
> in that said function. So to avoid unnecessary probe fails for devices
> using reset-gpios (it's an optional reset after all), let's treat an
> error as still optional at this point.
>
> This fixes operation of WiFi chips on Allwinner boards, where some use
> reset-gpios, and which currently fail because all Allwinner SoCs use
> GPIO controllers with 3 cells.
>
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> ---
> drivers/reset/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index 22f67fc77ae53..c2ccd08fb36e1 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -1044,7 +1044,7 @@ __of_reset_control_get(struct device_node *node, const char *id, int index,
>
> ret = __reset_add_reset_gpio_device(&args);
> if (ret) {
> - rstc = ERR_PTR(ret);
> + rstc = optional ? NULL : ERR_PTR(ret);
Please move this into __reset_add_reset_gpio_device() and pass flags
into it. Only the -ENOENT return value mentioned in the commit
description should be suppressed by the optional flag, not any -ENOMEM.
And especially not the return value of __reset_add_reset_gpio_lookup(),
which may be -EPROBE_DEFER.
regards
Philipp
More information about the linux-arm-kernel
mailing list