Skip to content

Commit 48c9996

Browse files
Sakari Ailusrafaeljw
authored andcommitted
device property: Add SOFTWARE_NODE() macro for defining software nodes
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> Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 693c667 commit 48c9996

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/linux/property.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,13 @@ struct software_node {
489489
const struct property_entry *properties;
490490
};
491491

492+
#define SOFTWARE_NODE(_name_, _properties_, _parent_) \
493+
(struct software_node) { \
494+
.name = _name_, \
495+
.properties = _properties_, \
496+
.parent = _parent_, \
497+
}
498+
492499
bool is_software_node(const struct fwnode_handle *fwnode);
493500
const struct software_node *
494501
to_software_node(const struct fwnode_handle *fwnode);

0 commit comments

Comments
 (0)