Skip to contentSkip to conversation

clk: fixed-rate: fix of_node_get-put imbalance

PATCH In review Alan Tull 2 participants 3 messages Oct 18, 2018 Common clk

lore
Share & tools
lore

Alan Tull

author
#0 lore raw

PATCH 1/1 clk: fixed-rate: fix of_node_get-put imbalance

When the fixed rate clock is created by devicetree, of_clk_add_provider is called. Add a call to of_clk_del_provider in the remove function to balance it out.

---
 drivers/clk/clk-fixed-rate.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/clk-fixed-rate.c +1 -0
index b5c46b3f8764..6d6475c32ee5 100644
@@ -200,6 +200,7 @@ static int of_fixed_clk_remove(struct platform_device *pdev)
 {
 	struct clk *clk = platform_get_drvdata(pdev);
 
+	of_clk_del_provider(pdev->dev.of_node);
 	clk_unregister_fixed_rate(clk);
 
 	return 0;
Signature · 1 line
2.16.2
maintainer
#1 lore raw

Quoting Alan Tull (2018-10-18 12:54:11)

Quoted 7 lines

When the fixed rate clock is created by devicetree, of_clk_add_provider is called. Add a call to of_clk_del_provider in the remove function to balance it out.

---

Fixes tag? I'll tack one on.

Quoted 15 lines
 drivers/clk/clk-fixed-rate.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/clk-fixed-rate.c +1 -0
index b5c46b3f8764..6d6475c32ee5 100644
@@ -200,6 +200,7 @@ static int of_fixed_clk_remove(struct platform_device *pdev)
 {
        struct clk *clk = platform_get_drvdata(pdev);
 
+       of_clk_del_provider(pdev->dev.of_node);
        clk_unregister_fixed_rate(clk);
 
        return 0;
author
#2 lore raw
Quoted 11 lines · Stephen Boyd

Quoting Alan Tull (2018-10-18 12:54:11)

Quoted 7 lines

When the fixed rate clock is created by devicetree, of_clk_add_provider is called. Add a call to of_clk_del_provider in the remove function to balance it out.

---

Fixes tag? I'll tack one on.

Fixes 435779fe1336 ("clk: fixed-rate: Convert into a module platform driver")

Thanks!
Alan

Quoted 16 lines
Quoted 16 lines
 drivers/clk/clk-fixed-rate.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/clk-fixed-rate.c +1 -0
index b5c46b3f8764..6d6475c32ee5 100644
@@ -200,6 +200,7 @@ static int of_fixed_clk_remove(struct platform_device *pdev)
 {
        struct clk *clk = platform_get_drvdata(pdev);
 
+       of_clk_del_provider(pdev->dev.of_node);
        clk_unregister_fixed_rate(clk);
 
        return 0;