Messages in this thread Patch in this message | | | From | "Rafael J. Wysocki" <> | Subject | [PATCH v2 4/6] device property: Add SOFTWARE_NODE() macro for defining software nodes | Date | Fri, 20 Oct 2023 16:38:25 +0200 |
| |
From: Sakari Ailus <sakari.ailus@linux.intel.com>
Add SOFTWARE_NODE() macro in order to make defining software nodes look nicer. This is analogous to different PROPERTY_ENTRY_*() macros for defining properties.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> --- include/linux/property.h | 7 +++++++ 1 file changed, 7 insertions(+)
Index: linux-pm/include/linux/property.h =================================================================== --- linux-pm.orig/include/linux/property.h +++ linux-pm/include/linux/property.h @@ -488,6 +488,13 @@ struct software_node { const struct property_entry *properties; }; +#define SOFTWARE_NODE(_name_, _properties_, _parent_) \ + (struct software_node) { \ + .name = _name_, \ + .properties = _properties_, \ + .parent = _parent_, \ + } + bool is_software_node(const struct fwnode_handle *fwnode); const struct software_node * to_software_node(const struct fwnode_handle *fwnode);
| |