summaryrefslogtreecommitdiff
path: root/include/of.h
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-28 08:45:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-07-18 07:14:12 +0200
commit9c88d8beb30df68a4fc84710de62f07486df30b8 (patch)
tree685b780e130f4a5477b8c19cb113de48e3abb4cf /include/of.h
parent44a012366d01a4cbbe1628998a203724cbf57aee (diff)
downloadbarebox-9c88d8beb30df68a4fc84710de62f07486df30b8.tar.gz
of: partition: implement of_partition_ensure_probed
The device tree nodes for both barebox environment and state can have phandles that reference partitions. Environment runs at late_initcall level, so deep probe will have populated the device by the time the probe is called. barebox-state however is probed at device_initcall level and thus must take care itself to ensure the partition provider is probed. Add a new of_partition_ensure_probed that does this. It can handle both legacy and new style (fixed) partitions. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/of.h')
-rw-r--r--include/of.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/of.h b/include/of.h
index d82790c052..f9c2b283de 100644
--- a/include/of.h
+++ b/include/of.h
@@ -283,6 +283,7 @@ extern int of_device_ensure_probed(struct device_node *np);
extern int of_device_ensure_probed_by_alias(const char *alias);
extern int of_devices_ensure_probed_by_property(const char *property_name);
extern int of_devices_ensure_probed_by_dev_id(const struct of_device_id *ids);
+extern int of_partition_ensure_probed(struct device_node *np);
struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node);
int of_parse_partitions(struct cdev *cdev, struct device_node *node);
@@ -392,6 +393,11 @@ of_devices_ensure_probed_by_dev_id(const struct of_device_id *ids)
return 0;
}
+static inline int of_partition_ensure_probed(struct device_node *np)
+{
+ return 0;
+}
+
static inline int of_bus_n_addr_cells(struct device_node *np)
{
return 0;