Skip to contentSkip to conversation

rtc: ntxec: fix OF node reference imbalance

PATCH Applied Johan Hovold 2 participants 2 messages Apr 7 – Apr 12

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: ntxec: fix OF node reference imbalance

The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices.

Fix this by using the intended helper for reusing OF nodes.

Fixes 435af89786c6 ("rtc: New driver for RTC in Netronix embedded controller")
Cc Jonathan Neuschäfer <[email protected]>
---
 drivers/rtc/rtc-ntxec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-ntxec.c +1 -1
index 850ca49186fd..d28ddb34e19e 100644
@@ -110,7 +110,7 @@ static int ntxec_rtc_probe(struct platform_device *pdev)
 	struct rtc_device *dev;
 	struct ntxec_rtc *rtc;
 
-	pdev->dev.of_node = pdev->dev.parent->of_node;
+	device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
 
 	rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
 	if (!rtc)
Signature · 1 line
2.52.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Johan Hovold

The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices.

Fix this by using the intended helper for reusing OF nodes.

[...]

Applied, thanks!

[1/1] rtc: ntxec: fix OF node reference imbalance

      https://git.kernel.org/abelloni/c/30c4d2f26bb3

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com