Skip to content

Commit

Permalink
device property: Retrieve fwnode from of_node via accessor
Browse files Browse the repository at this point in the history
OF provides a specific accessor to retrieve fwnode handle.
Use it instead of direct dereferencing.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Andy Shevchenko authored and Rafael J. Wysocki committed May 10, 2021
1 parent 6efb943 commit 3cd8015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/base/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
struct fwnode_handle *dev_fwnode(struct device *dev)
{
return IS_ENABLED(CONFIG_OF) && dev->of_node ?
&dev->of_node->fwnode : dev->fwnode;
of_fwnode_handle(dev->of_node) : dev->fwnode;
}
EXPORT_SYMBOL_GPL(dev_fwnode);

Expand Down Expand Up @@ -763,7 +763,7 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,
struct fwnode_handle *fwnode = NULL, *next;

if (dev->of_node)
fwnode = &dev->of_node->fwnode;
fwnode = of_fwnode_handle(dev->of_node);
else if (adev)
fwnode = acpi_fwnode_handle(adev);

Expand Down

0 comments on commit 3cd8015

Please sign in to comment.