Skip to content

Commit 3cd8015

Browse files
andy-shevrafaeljw
authored andcommitted
device property: Retrieve fwnode from of_node via accessor
OF provides a specific accessor to retrieve fwnode handle. Use it instead of direct dereferencing. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 6efb943 commit 3cd8015

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/base/property.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
struct fwnode_handle *dev_fwnode(struct device *dev)
2222
{
2323
return IS_ENABLED(CONFIG_OF) && dev->of_node ?
24-
&dev->of_node->fwnode : dev->fwnode;
24+
of_fwnode_handle(dev->of_node) : dev->fwnode;
2525
}
2626
EXPORT_SYMBOL_GPL(dev_fwnode);
2727

@@ -763,7 +763,7 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,
763763
struct fwnode_handle *fwnode = NULL, *next;
764764

765765
if (dev->of_node)
766-
fwnode = &dev->of_node->fwnode;
766+
fwnode = of_fwnode_handle(dev->of_node);
767767
else if (adev)
768768
fwnode = acpi_fwnode_handle(adev);
769769

0 commit comments

Comments
 (0)