mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/2] device property: Retrieve fwnode from of_node via accessor
@ 2021-05-10  9:56 Andy Shevchenko
  2021-05-10  9:56 ` [PATCH v1 2/2] device property: Don't check for NULL twice in the loops Andy Shevchenko
  2021-05-10 14:57 ` [PATCH v1 1/2] device property: Retrieve fwnode from of_node via accessor Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-05-10  9:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andy Shevchenko, linux-kernel; +Cc: Rafael J. Wysocki

OF provides a specific accessor to retrieve fwnode handle.
Use it instead of direct dereferencing.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/base/property.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 1421e9548857..dd98759d688b 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -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);
 
@@ -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);
 
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-10 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10  9:56 [PATCH v1 1/2] device property: Retrieve fwnode from of_node via accessor Andy Shevchenko
2021-05-10  9:56 ` [PATCH v1 2/2] device property: Don't check for NULL twice in the loops Andy Shevchenko
2021-05-10 14:53   ` Rafael J. Wysocki
2021-05-10 14:57 ` [PATCH v1 1/2] device property: Retrieve fwnode from of_node via accessor Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®