Skip to contentSkip to conversation

mfd: take OF node reference for MFD cell platform device

PATCH In review Sebastian Urban 2 participants 3 messages Sep 17, 2022 – Oct 18, 2022 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: take OF node reference for MFD cell platform device

Properly increase OF node reference count when assigning it to a platform device created for an MFD cell.

---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mfd-core.c +1 -1
index 16d1861e9682..8e57f67719cf 100644
@@ -161,7 +161,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 	of_entry->np = np;
 	list_add_tail(&of_entry->list, &mfd_of_node_list);
 
-	pdev->dev.of_node = np;
+	pdev->dev.of_node = of_node_get(np);
 	pdev->dev.fwnode = &np->fwnode;
 #endif
 	return 0;
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 13 lines · Sebastian Urban

Properly increase OF node reference count when assigning it to a platform device created for an MFD cell.

---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mfd-core.c +0 -0
index 16d1861e9682..8e57f67719cf 100644

drivers/mfd/mfd-core.c static int mfd_match_of_node_to_dev(struct platform_device *pdev, · line 164

Quoted 5 lines
drivers/mfd/mfd-core.c +1 -1
@@ -161,7 +161,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 	of_entry->np = np;
 	list_add_tail(&of_entry->list, &mfd_of_node_list);
 
-	pdev->dev.of_node = np;
+	pdev->dev.of_node = of_node_get(np);

Doesn't this cause an imbalance?

Or is there already a put somewhere?

Quoted 3 lines
drivers/mfd/mfd-core.c +0 -0
 	pdev->dev.fwnode = &np->fwnode;
 #endif
 	return 0;
Signature · 1 line
Lee Jones [李琼斯]
maintainer
#2 lore raw
Quoted 18 lines · Lee Jones
Quoted 16 lines · Sebastian Urban

Properly increase OF node reference count when assigning it to a platform device created for an MFD cell.

---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mfd-core.c +0 -0
index 16d1861e9682..8e57f67719cf 100644
@@ -161,7 +161,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 	of_entry->np = np;
 	list_add_tail(&of_entry->list, &mfd_of_node_list);
 
Quoted 6 lines

drivers/mfd/mfd-core.c static int mfd_match_of_node_to_dev(struct platform_device *pdev, · line 164

Quoted 2 lines
drivers/mfd/mfd-core.c +1 -1
-	pdev->dev.of_node = np;
+	pdev->dev.of_node = of_node_get(np);

Doesn't this cause an imbalance?

Or is there already a put somewhere?

I can't accept this until you've answered my queries.

Signature · 1 line
Lee Jones [李琼斯]