diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-06-07 14:07:00 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-06-08 09:29:46 +0200 |
commit | 2d0da8f0915a6e8f0996645b2adfb978dfe7e7e0 (patch) | |
tree | 02898885c41bc9a812b08222edb0af118375c5b7 /common/state/state.c | |
parent | dc783fa839016705a37b2d773dc2ed17583a8fe5 (diff) | |
download | barebox-2d0da8f0915a6e8f0996645b2adfb978dfe7e7e0.tar.gz barebox-2d0da8f0915a6e8f0996645b2adfb978dfe7e7e0.tar.xz |
state: fix deep probe handling
State backend doesn't necessarily point at a device tree node that has a
device associated, e.g. when we have a top-level fixed-partitions node
with the barebox-specific partuuid binding. As of_find_path_by_node will
iterate over all available cdev's we need not handle the error and can
just call of_find_path_by_node.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230607120714.3083182-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/state/state.c')
-rw-r--r-- | common/state/state.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/common/state/state.c b/common/state/state.c index cabe285fbd..726cf3ac96 100644 --- a/common/state/state.c +++ b/common/state/state.c @@ -615,9 +615,15 @@ struct state *state_new_from_node(struct device_node *node, bool readonly) } #ifdef __BAREBOX__ - ret = of_partition_ensure_probed(partition_node); - if (ret) - goto out_release_state; + /* + * On EFI, where devices are not instantiated from device tree, the + * state backend may point at a top-level fixed-partitions partition + * subnode with a partuuid property, which will be looked up globally. + * + * In order to support this binding, we do not early exit when + * of_partition_ensure_probed fails, but instead try the custom binding. + */ + (void)of_partition_ensure_probed(partition_node); ret = of_find_path_by_node(partition_node, &state->backend_path, 0); #else |