* [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located
@ 2020-05-03 12:18 Claudiu Beznea
2020-05-03 12:18 ` [PATCH 2/2] clk: at91: pmc: decrement node's refcount Claudiu Beznea
2020-05-27 3:22 ` [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Claudiu Beznea @ 2020-05-03 12:18 UTC (permalink / raw)
To: mturquette, sboyd, nicolas.ferre, alexandre.belloni, ludovic.desroches
Cc: linux-clk, linux-arm-kernel, linux-kernel, Claudiu Beznea
pmc_register_ops() is called for all AT91 devices. Return
-ENODEV in case of_find_matching_node() returns NULL.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
drivers/clk/at91/pmc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index b71515acdec1..bf0570e66fc1 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -274,6 +274,8 @@ static int __init pmc_register_ops(void)
struct device_node *np;
np = of_find_matching_node(NULL, sama5d2_pmc_dt_ids);
+ if (!np)
+ return -ENODEV;
pmcreg = device_node_to_regmap(np);
if (IS_ERR(pmcreg))
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] clk: at91: pmc: decrement node's refcount
2020-05-03 12:18 [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located Claudiu Beznea
@ 2020-05-03 12:18 ` Claudiu Beznea
2020-05-27 3:22 ` Stephen Boyd
2020-05-27 3:22 ` [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Claudiu Beznea @ 2020-05-03 12:18 UTC (permalink / raw)
To: mturquette, sboyd, nicolas.ferre, alexandre.belloni, ludovic.desroches
Cc: linux-clk, linux-arm-kernel, linux-kernel, Claudiu Beznea
of_find_matching_node() increment node's refcount. Call
of_node_put() to decrement it after it was used.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
drivers/clk/at91/pmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index bf0570e66fc1..e164069c81bd 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -278,6 +278,7 @@ static int __init pmc_register_ops(void)
return -ENODEV;
pmcreg = device_node_to_regmap(np);
+ of_node_put(np);
if (IS_ERR(pmcreg))
return PTR_ERR(pmcreg);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located
2020-05-03 12:18 [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located Claudiu Beznea
2020-05-03 12:18 ` [PATCH 2/2] clk: at91: pmc: decrement node's refcount Claudiu Beznea
@ 2020-05-27 3:22 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2020-05-27 3:22 UTC (permalink / raw)
To: Claudiu Beznea, alexandre.belloni, ludovic.desroches, mturquette,
nicolas.ferre
Cc: linux-clk, linux-arm-kernel, linux-kernel, Claudiu Beznea
Quoting Claudiu Beznea (2020-05-03 05:18:08)
> pmc_register_ops() is called for all AT91 devices. Return
> -ENODEV in case of_find_matching_node() returns NULL.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] clk: at91: pmc: decrement node's refcount
2020-05-03 12:18 ` [PATCH 2/2] clk: at91: pmc: decrement node's refcount Claudiu Beznea
@ 2020-05-27 3:22 ` Stephen Boyd
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2020-05-27 3:22 UTC (permalink / raw)
To: Claudiu Beznea, alexandre.belloni, ludovic.desroches, mturquette,
nicolas.ferre
Cc: linux-clk, linux-arm-kernel, linux-kernel, Claudiu Beznea
Quoting Claudiu Beznea (2020-05-03 05:18:09)
> of_find_matching_node() increment node's refcount. Call
> of_node_put() to decrement it after it was used.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-27 3:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-03 12:18 [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located Claudiu Beznea
2020-05-03 12:18 ` [PATCH 2/2] clk: at91: pmc: decrement node's refcount Claudiu Beznea
2020-05-27 3:22 ` Stephen Boyd
2020-05-27 3:22 ` [PATCH 1/2] clk: at91: pmc: do not continue if compatible not located Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).