From: Conor Dooley <conor@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Linus Walleij <linusw@kernel.org>, Frank Li <Frank.Li@nxp.com>,
Conor Dooley <conor.dooley@microchip.com>,
Arnd Bergmann <arnd@arndb.de>,
Andy Shevchenko <andriy.shevchenko@intel.com>,
Dan Carpenter <error27@gmail.com>,
AKASHI Takahiro <takahiro.akashi@linaro.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pinctrl: avoid duplicate function definitions
Date: Wed, 20 May 2026 15:13:05 +0100 [thread overview]
Message-ID: <20260520-princess-garden-a6d5ad4f164a@spud> (raw)
In-Reply-To: <20260520075125.1514312-1-arnd@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3238 bytes --]
On Wed, May 20, 2026 at 09:51:14AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The pinctrl_generic_to_map() and pinctrl_generic_pins_function_dt_node_to_map()
> functions are built whenever CONFIG_GENERIC_PINCTRL is enabled, including
> configurations without CONFIG_OF.
>
> When CONFIG_OF is disabled, the dummy definitions are also present in the header,
> which causes the build to fail:
>
> drivers/pinctrl/pinctrl-generic.c:20:5: error: conflicting types for 'pinctrl_generic_to_map'; have 'int(struct pinctrl_dev *, struct device_node *, struct device_node *, struct pinctrl_map **, unsigned int *, unsigned int *, const char **, unsigned int, const char **, unsigned int *, unsigned int)'
> 20 | int pinctrl_generic_to_map(struct pinctrl_dev *pctldev, struct device_node *parent,
> | ^~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/pinctrl/pinctrl-generic.c:16:
> drivers/pinctrl/pinconf.h:193:1: note: previous definition of 'pinctrl_generic_to_map' with type 'int(struct pinctrl_dev *, struct device_node *, struct device_node *, struct pinctrl_map **, unsigned int *, unsigned int *, const char **, unsigned int, const char **, unsigned int *, void *)'
> 193 | pinctrl_generic_to_map(struct pinctrl_dev *pctldev, struct device_node *parent,
> | ^~~~~~~~~~~~~~~~~~~~~~
> drivers/pinctrl/pinctrl-generic.c:130:5: error: redefinition of 'pinctrl_generic_pins_function_dt_node_to_map'
> 130 | int pinctrl_generic_pins_function_dt_node_to_map(struct pinctrl_dev *pctldev,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/pinctrl/pinconf.h:184:1: note: previous definition of 'pinctrl_generic_pins_function_dt_node_to_map' with type 'int(struct pinctrl_dev *, struct device_node *, struct pinctrl_map **, unsigned int *)'
> 184 | pinctrl_generic_pins_function_dt_node_to_map(struct pinctrl_dev *pctldev,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Removing either set of definitions is sufficient to avoid the problem.
>
> Remove the copy from the header for simplicity.
>
> Fixes: aaaf31be0426 ("pinctrl: extract pinctrl_generic_to_map() from pinctrl_generic_pins_function_dt_node_to_map()")
> Fixes: 43722575e5cd ("pinctrl: add generic functions + pins mapper")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
And all of the of functions it uses have NOP variants don't they, so
this is the correct fix from a build coverage point of view.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Cheers,
Conor.
> ---
> drivers/pinctrl/pinconf.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h
> index fa8fb0d290d1..60c0e9ac0464 100644
> --- a/drivers/pinctrl/pinconf.h
> +++ b/drivers/pinctrl/pinconf.h
> @@ -167,7 +167,7 @@ pinconf_generic_parse_dt_pinmux(struct device_node *np, struct device *dev,
> }
> #endif
>
> -#if defined(CONFIG_GENERIC_PINCTRL) && defined (CONFIG_OF)
> +#if defined(CONFIG_GENERIC_PINCTRL)
> int pinctrl_generic_pins_function_dt_node_to_map(struct pinctrl_dev *pctldev,
> struct device_node *np,
> struct pinctrl_map **maps,
> --
> 2.39.5
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-05-20 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 7:51 Arnd Bergmann
2026-05-20 14:13 ` Conor Dooley [this message]
2026-05-20 14:30 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260520-princess-garden-a6d5ad4f164a@spud \
--to=conor@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=andriy.shevchenko@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=error27@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=takahiro.akashi@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®