From: Laurent Pinchart Date: Wed, 1 Jul 2020 06:21:37 +0000 (+0200) Subject: media: device property: Add a function to test is a fwnode is a graph endpoint X-Git-Tag: v5.9-rc1~94^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35694afc92646ac24d7f3ef34a7387876d998fe7;p=thirdparty%2Fkernel%2Flinux.git media: device property: Add a function to test is a fwnode is a graph endpoint Drivers may need to test if a fwnode is a graph endpoint. To avoid hand-written solutions that wouldn't work for all fwnode types, add a new fwnode_graph_is_endpoint() function for this purpose. We don't need to wire it up to different backends for OF and ACPI for now, as the implementation can simply be based on checkout the presence of a remote-endpoint property. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Lad Prabhakar Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/include/linux/property.h b/include/linux/property.h index 10d03572f52e5..9f805c4428195 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -389,6 +389,11 @@ struct fwnode_handle * fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, u32 endpoint); +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) +{ + return fwnode_property_present(fwnode, "remote-endpoint"); +} + /* * Fwnode lookup flags *