[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251002222826.16516-1-andre.przywara@arm.com>
Date: Thu, 2 Oct 2025 23:28:26 +0100
From: Andre Przywara <andre.przywara@....com>
To: Philipp Zabel <p.zabel@...gutronix.de>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: linux-sunxi@...ts.linux.dev,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH] reset: core: reset-gpio: Suppress registration error for optional resets
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@....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);
goto out_put;
}
}
--
2.46.4
Powered by blists - more mailing lists