Skip to contentSkip to conversation

slimbus: core: Set fwnode for a device when setting of_node

RFC PATCH In review John Stultz 2 participants 3 messages Jun 5, 2020 Serial low-power inter-chip media bus (SLIMbus)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 slimbus: core: Set fwnode for a device when setting of_node

From: Saravana Kannan <[email protected]>

When setting the of_node for a newly created device, also set the fwnode. This allows fw_devlink to work for slimbus devices.

---
 drivers/slimbus/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/slimbus/core.c +3 -1
index 526e3215d8fe..44228a5b246d 100644
@@ -163,8 +163,10 @@ static int slim_add_device(struct slim_controller *ctrl,
 	INIT_LIST_HEAD(&sbdev->stream_list);
 	spin_lock_init(&sbdev->stream_list_lock);
 
-	if (node)
+	if (node) {
 		sbdev->dev.of_node = of_node_get(node);
+		sbdev->dev.fwnode = of_fwnode_handle(node);
+	}
 
 	dev_set_name(&sbdev->dev, "%x:%x:%x:%x",
 				  sbdev->e_addr.manf_id,
Signature · 1 line
2.17.1
#1 lore raw

Hi John,

Quoted 10 lines · John Stultz

From: Saravana Kannan <[email protected]>

When setting the of_node for a newly created device, also set the fwnode. This allows fw_devlink to work for slimbus devices.

I thought Srinivas already picked this up and sent it to Greg.
https://lore.kernel.org/lkml/[email protected]/

Am I missing something?

-Saravana

#2 lore raw
Quoted 7 lines · Saravana Kannan
Quoted 6 lines · John Stultz

From: Saravana Kannan <[email protected]>

When setting the of_node for a newly created device, also set the fwnode. This allows fw_devlink to work for slimbus devices.

Quoted 8 lines
Quoted 4 lines

I thought Srinivas already picked this up and sent it to Greg.
https://lore.kernel.org/lkml/[email protected]/

Oh! I'm sorry, I missed that! That's great to hear!

thanks
-john