[PATCH 17/18] of: define of_devices_ensure_probed_by_compatible
Sascha Hauer
sha at pengutronix.de
Mon Nov 13 04:47:40 PST 2023
On Fri, Nov 10, 2023 at 10:44:20PM +0100, Ahmad Fatoum wrote:
> 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 at pengutronix.de>
> ---
> include/of.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/of.h b/include/of.h
> index a7a1ce125fc0..7ebf1f02cc68 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -1220,6 +1220,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(char *compatible)
Should the argument be const char *?
We would have to change struct of_device_id::compatible to const char *
as well, but at least a test build of multi_v8_defconfig showed no
problems with this change.
Sascha
> +{
> + 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
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list