[PATCH v2 19/20] of: define of_devices_ensure_probed_by_compatible

Ahmad Fatoum
2023-11-22T17:42:52Z

We will need to ensure probe of OP-TEE from SCMI code in a follow-up
commit, so add a small helper to facilitate this.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
- changed prototype to take const char * instead of char * (Sascha)
---
include/of.h | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/include/of.h b/include/of.h
index e99b41ef6f14..7d1df462d8cf 100644
--- a/include/of.h
+++ b/include/of.h
@@ -1221,6 +1221,16 @@ int of_device_disable(struct device_node *node);
int of_device_disable_path(const char *path);
int of_device_disable_by_alias(const char *alias);

+static inline int of_devices_ensure_probed_by_compatible(const char *compatible)
+{
+ struct of_device_id match_id[] = {
+ { .compatible = compatible, },
+ { /* sentinel */ },
+ };
+
+ return of_devices_ensure_probed_by_dev_id(match_id);
+}
+
phandle of_get_tree_max_phandle(struct device_node *root);
phandle of_node_create_phandle(struct device_node *node);
int of_set_property_to_child_phandle(struct device_node *node, char *prop_name);
--
2.39.2