reset: core: reset-gpio: Suppress registration error for optional resets
Commit Message
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@arm.com>
---
drivers/reset/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -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;
}
}