diff mbox series

[1/2] clk: at91: pmc: do not continue if compatible not located

Message ID 1588508289-10140-1-git-send-email-claudiu.beznea@microchip.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/2] clk: at91: pmc: do not continue if compatible not located | expand

Commit Message

Claudiu Beznea May 3, 2020, 12:18 p.m. UTC
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(+)

Comments

Stephen Boyd May 27, 2020, 3:22 a.m. UTC | #1
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
diff mbox series

Patch

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))