Linux-GPIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] pinctrl: renesas: checker: Restrict checks to Renesas platforms
@ 2021-01-11 14:06 Geert Uytterhoeven
  2021-01-11 14:36 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2021-01-11 14:06 UTC (permalink / raw)
  To: Arnd Bergmann, Linus Walleij
  Cc: linux-renesas-soc, linux-sh, linux-arm-kernel, linux-gpio,
	Geert Uytterhoeven

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>
---
To be queued in renesas-pinctrl-for-v5.12.

 drivers/pinctrl/renesas/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c
index b9f80833f532e7b7..56cb8e1d8384b39c 100644
--- a/drivers/pinctrl/renesas/core.c
+++ b/drivers/pinctrl/renesas/core.c
@@ -1146,6 +1146,11 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv)
 {
 	unsigned int i;
 
+#ifndef CONFIG_SUPERH
+	if (!of_find_matching_node(NULL, pdrv->driver.of_match_table))
+		return;
+#endif
+
 	sh_pfc_regs = kcalloc(SH_PFC_MAX_REGS, sizeof(*sh_pfc_regs),
 			      GFP_KERNEL);
 	if (!sh_pfc_regs)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: renesas: checker: Restrict checks to Renesas platforms
  2021-01-11 14:06 [PATCH] pinctrl: renesas: checker: Restrict checks to Renesas platforms Geert Uytterhoeven
@ 2021-01-11 14:36 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2021-01-11 14:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Arnd Bergmann, Linus Walleij, Linux-Renesas, Linux-sh list,
	Linux ARM, open list:GPIO SUBSYSTEM

On Mon, Jan 11, 2021 at 3:06 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> 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>

Thank you for addressing it,

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

> ---
> To be queued in renesas-pinctrl-for-v5.12.
>
>  drivers/pinctrl/renesas/core.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c
> index b9f80833f532e7b7..56cb8e1d8384b39c 100644
> --- a/drivers/pinctrl/renesas/core.c
> +++ b/drivers/pinctrl/renesas/core.c
> @@ -1146,6 +1146,11 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv)
>  {
>         unsigned int i;
>
> +#ifndef CONFIG_SUPERH
> +       if (!of_find_matching_node(NULL, pdrv->driver.of_match_table))
> +               return;
> +#endif

I usually prefer writing this as

       if (!IS_ENABLED(CONFIG_SUPERH) &&
           !of_find_matching_node(NULL, pdrv->driver.of_match_table))

but I don't care enough to ask you to resend ;-)

       Arnd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 14:06 [PATCH] pinctrl: renesas: checker: Restrict checks to Renesas platforms Geert Uytterhoeven
2021-01-11 14:36 ` Arnd Bergmann

Linux-GPIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-gpio/0 linux-gpio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-gpio linux-gpio/ https://lore.kernel.org/linux-gpio \
		linux-gpio@vger.kernel.org
	public-inbox-index linux-gpio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-gpio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git