summaryrefslogtreecommitdiffstats
path: root/drivers/reset/core.c
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2023-01-09 09:36:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-01-09 10:11:34 +0100
commita6ba83b084415c508bebd4e336aff783cf299725 (patch)
treee2d7fbe8d8ed254976721ec81da629f2006479cd /drivers/reset/core.c
parente429dda7a69b2b32e684c5a86bd3cd5f31339f43 (diff)
downloadbarebox-a6ba83b084415c508bebd4e336aff783cf299725.tar.gz
barebox-a6ba83b084415c508bebd4e336aff783cf299725.tar.xz
reset: core: support deep probe with resets registered in CLK_OF_DECLARE
We already have such an exception for clocks, which may be registered early outside the driver model using CLK_OF_DECLARE. Add a further exception for reset controllers, so they too may be registered in CLK_OF_DECLARE on a deep probe system. Checking for success of of_device_ensure_probed() here isn't necessary anyways, because if there is no provider, the list_for_each_entry loop below won't find any and error is propagated. Another solution would be to rewrite deep probe drivers to use the driver model instead of CLK_OF_DECLARE, but this error case if not very obvious, so save others time by just allowing it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230109083600.1820078-3-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/reset/core.c')
-rw-r--r--drivers/reset/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index b252f94d6e..e2470f3ca1 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -191,9 +191,8 @@ static struct reset_control *of_reset_control_get_by_index(struct device_node *n
if (ret)
return ERR_PTR(ret);
- ret = of_device_ensure_probed(args.np);
- if (ret)
- return ERR_PTR(ret);
+ /* Ignore error, as CLK_OF_DECLARE resets have no proper driver. */
+ of_device_ensure_probed(args.np);
rcdev = NULL;
list_for_each_entry(r, &reset_controller_list, list) {