[PATCH v2 06/26] driver core: fw_devlink: Introduce fw_devlink_set_device()

Herve Codina herve.codina at bootlin.com
Wed May 7 00:12:48 PDT 2025


Setting fwnode->dev is specific to fw_devlink.

In order to avoid having a direct 'fwnode->dev = dev;' in several
place in the kernel, introduce fw_devlink_set_device() helper to perform
this operation.

Signed-off-by: Herve Codina <herve.codina at bootlin.com>
---
 include/linux/fwnode.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index af76de93bee2..9fc4427b1004 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -226,4 +226,10 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
 void fw_devlink_refresh_fwnode(struct fwnode_handle *fwnode);
 bool fw_devlink_is_strict(void);
 
+static inline void fw_devlink_set_device(struct fwnode_handle *fwnode,
+					 struct device *dev)
+{
+	fwnode->dev = dev;
+}
+
 #endif
-- 
2.49.0




More information about the linux-arm-kernel mailing list