From: Claudiu Beznea Date: Sun, 3 May 2020 12:18:08 +0000 (+0300) Subject: clk: at91: pmc: do not continue if compatible not located X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f6363c437dc6e287259c05849286bf0faefb0fdd;p=linux.git 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 Link: https://lkml.kernel.org/r/1588508289-10140-1-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index b71515acdec1f..bf0570e66fc1f 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))