Skip to content

Commit f6363c4

Browse files
claudiubezneabebarino
authored andcommitted
clk: at91: pmc: do not continue if compatible not located
pmc_register_ops() is called for all AT91 devices. Return -ENODEV in case of_find_matching_node() returns NULL. Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 99e1074 commit f6363c4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/clk/at91/pmc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ static int __init pmc_register_ops(void)
274274
struct device_node *np;
275275

276276
np = of_find_matching_node(NULL, sama5d2_pmc_dt_ids);
277+
if (!np)
278+
return -ENODEV;
277279

278280
pmcreg = device_node_to_regmap(np);
279281
if (IS_ERR(pmcreg))

0 commit comments

Comments
 (0)