pinctrl: renesas: checker: Restrict checks to Renesas platforms
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 Jan 2021 16:50:13 +0000 (17:50 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 12 Jan 2021 09:45:43 +0000 (10:45 +0100)
When DEBUG is defined (e.g. if CONFIG_DEBUG_PINCTRL=y), the Renesas pin
control driver runs sanity checks against the pin control tables.  This
may cause lots of output on the console, and can be annoying in ARM
multi-platform kernels.  Fix this by only running the checks when
running on SuperH, or on a DT platform supported by the Renesas pin
controller driver.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210111165013.496897-1-geert+renesas@glider.be
drivers/pinctrl/renesas/core.c

index 2cc457279345b95dce9dc28d2338e3cb828e394c..291d2c673b8fa282ab5abf1d11e9811b82b05fa0 100644 (file)
@@ -1052,6 +1052,10 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv)
 {
        unsigned int i;
 
+       if (!IS_ENABLED(CONFIG_SUPERH) &&
+           !of_find_matching_node(NULL, pdrv->driver.of_match_table))
+               return;
+
        sh_pfc_regs = kcalloc(SH_PFC_MAX_REGS, sizeof(*sh_pfc_regs),
                              GFP_KERNEL);
        if (!sh_pfc_regs)