summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2020-05-03 15:18:08 +0300
committerStephen Boyd <sboyd@kernel.org>2020-05-26 20:22:02 -0700
commitf6363c437dc6e287259c05849286bf0faefb0fdd (patch)
treef6ce4bcaea581f5e4a3ce6e4ca59f60fbbf11caa /drivers
parent99e107439eea0dcd993f6d92f3db530772979861 (diff)
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 <claudiu.beznea@microchip.com> Link: https://lkml.kernel.org/r/1588508289-10140-1-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/at91/pmc.c2
1 files changed, 2 insertions, 0 deletions
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))