From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: "Avi Fishman" <avifishman70@gmail.com>,
"Tomer Maimon" <tmaimon77@gmail.com>,
"Tali Perry" <tali.perry1@gmail.com>,
"Patrick Venture" <venture@google.com>,
"Nancy Yuen" <yuenn@google.com>,
"Benjamin Fair" <benjaminfair@google.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] pinctrl: nuvoton: Use pinconf_generic_dt_node_to_map_all()
Date: Sun, 27 Aug 2023 20:34:50 +0200 [thread overview]
Message-ID: <ZOuXSiR9UXtK/SlV@probook> (raw)
In-Reply-To: <81e9ab48f78d63153b23a163b3349b3059d2b7fc.1692871558.git.geert+renesas@glider.be>
[-- Attachment #1: Type: text/plain, Size: 3159 bytes --]
On Thu, Aug 24, 2023 at 12:07:44PM +0200, Geert Uytterhoeven wrote:
> Use the pinconf_generic_dt_node_to_map_all() helper instead of
> open-coding the same operation, to avoid having to provide custom
> pinctrl_ops.dt_node_to_map() callbacks.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This does sacrifice a debug print in the process. Does anyone care?
> ---
> drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 15 +--------------
> drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 12 +-----------
> 2 files changed, 2 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> index 843ffcd968774774..8bdd0124e2eb9467 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> @@ -1588,19 +1588,6 @@ static int npcm7xx_get_group_pins(struct pinctrl_dev *pctldev,
> return 0;
> }
>
> -static int npcm7xx_dt_node_to_map(struct pinctrl_dev *pctldev,
> - struct device_node *np_config,
> - struct pinctrl_map **map,
> - u32 *num_maps)
> -{
> - struct npcm7xx_pinctrl *npcm = pinctrl_dev_get_drvdata(pctldev);
> -
> - dev_dbg(npcm->dev, "dt_node_to_map: %s\n", np_config->name);
> - return pinconf_generic_dt_node_to_map(pctldev, np_config,
> - map, num_maps,
> - PIN_MAP_TYPE_INVALID);
> -}
> -
> static void npcm7xx_dt_free_map(struct pinctrl_dev *pctldev,
> struct pinctrl_map *map, u32 num_maps)
> {
> @@ -1612,7 +1599,7 @@ static const struct pinctrl_ops npcm7xx_pinctrl_ops = {
> .get_group_name = npcm7xx_get_group_name,
> .get_group_pins = npcm7xx_get_group_pins,
> .pin_dbg_show = npcm7xx_pin_dbg_show,
> - .dt_node_to_map = npcm7xx_dt_node_to_map,
> + .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
> .dt_free_map = npcm7xx_dt_free_map,
> };
>
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> index 2d1c1652cfd9d373..6e88ef1ed020fa88 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> @@ -858,16 +858,6 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
> return 0;
> }
>
> -static int wpcm450_dt_node_to_map(struct pinctrl_dev *pctldev,
> - struct device_node *np_config,
> - struct pinctrl_map **map,
> - u32 *num_maps)
> -{
> - return pinconf_generic_dt_node_to_map(pctldev, np_config,
> - map, num_maps,
> - PIN_MAP_TYPE_INVALID);
> -}
> -
> static void wpcm450_dt_free_map(struct pinctrl_dev *pctldev,
> struct pinctrl_map *map, u32 num_maps)
> {
> @@ -878,7 +868,7 @@ static const struct pinctrl_ops wpcm450_pinctrl_ops = {
> .get_groups_count = wpcm450_get_groups_count,
> .get_group_name = wpcm450_get_group_name,
> .get_group_pins = wpcm450_get_group_pins,
> - .dt_node_to_map = wpcm450_dt_node_to_map,
> + .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
> .dt_free_map = wpcm450_dt_free_map,
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: "Benjamin Fair" <benjaminfair@google.com>,
linux-gpio@vger.kernel.org,
"Avi Fishman" <avifishman70@gmail.com>,
"Patrick Venture" <venture@google.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
"Tali Perry" <tali.perry1@gmail.com>,
openbmc@lists.ozlabs.org, "Tomer Maimon" <tmaimon77@gmail.com>
Subject: Re: [PATCH] pinctrl: nuvoton: Use pinconf_generic_dt_node_to_map_all()
Date: Sun, 27 Aug 2023 20:34:50 +0200 [thread overview]
Message-ID: <ZOuXSiR9UXtK/SlV@probook> (raw)
In-Reply-To: <81e9ab48f78d63153b23a163b3349b3059d2b7fc.1692871558.git.geert+renesas@glider.be>
[-- Attachment #1: Type: text/plain, Size: 3159 bytes --]
On Thu, Aug 24, 2023 at 12:07:44PM +0200, Geert Uytterhoeven wrote:
> Use the pinconf_generic_dt_node_to_map_all() helper instead of
> open-coding the same operation, to avoid having to provide custom
> pinctrl_ops.dt_node_to_map() callbacks.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This does sacrifice a debug print in the process. Does anyone care?
> ---
> drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 15 +--------------
> drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 12 +-----------
> 2 files changed, 2 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> index 843ffcd968774774..8bdd0124e2eb9467 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
> @@ -1588,19 +1588,6 @@ static int npcm7xx_get_group_pins(struct pinctrl_dev *pctldev,
> return 0;
> }
>
> -static int npcm7xx_dt_node_to_map(struct pinctrl_dev *pctldev,
> - struct device_node *np_config,
> - struct pinctrl_map **map,
> - u32 *num_maps)
> -{
> - struct npcm7xx_pinctrl *npcm = pinctrl_dev_get_drvdata(pctldev);
> -
> - dev_dbg(npcm->dev, "dt_node_to_map: %s\n", np_config->name);
> - return pinconf_generic_dt_node_to_map(pctldev, np_config,
> - map, num_maps,
> - PIN_MAP_TYPE_INVALID);
> -}
> -
> static void npcm7xx_dt_free_map(struct pinctrl_dev *pctldev,
> struct pinctrl_map *map, u32 num_maps)
> {
> @@ -1612,7 +1599,7 @@ static const struct pinctrl_ops npcm7xx_pinctrl_ops = {
> .get_group_name = npcm7xx_get_group_name,
> .get_group_pins = npcm7xx_get_group_pins,
> .pin_dbg_show = npcm7xx_pin_dbg_show,
> - .dt_node_to_map = npcm7xx_dt_node_to_map,
> + .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
> .dt_free_map = npcm7xx_dt_free_map,
> };
>
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> index 2d1c1652cfd9d373..6e88ef1ed020fa88 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> @@ -858,16 +858,6 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
> return 0;
> }
>
> -static int wpcm450_dt_node_to_map(struct pinctrl_dev *pctldev,
> - struct device_node *np_config,
> - struct pinctrl_map **map,
> - u32 *num_maps)
> -{
> - return pinconf_generic_dt_node_to_map(pctldev, np_config,
> - map, num_maps,
> - PIN_MAP_TYPE_INVALID);
> -}
> -
> static void wpcm450_dt_free_map(struct pinctrl_dev *pctldev,
> struct pinctrl_map *map, u32 num_maps)
> {
> @@ -878,7 +868,7 @@ static const struct pinctrl_ops wpcm450_pinctrl_ops = {
> .get_groups_count = wpcm450_get_groups_count,
> .get_group_name = wpcm450_get_group_name,
> .get_group_pins = wpcm450_get_group_pins,
> - .dt_node_to_map = wpcm450_dt_node_to_map,
> + .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
> .dt_free_map = wpcm450_dt_free_map,
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-08-27 18:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 10:07 [PATCH] pinctrl: nuvoton: Use pinconf_generic_dt_node_to_map_all() Geert Uytterhoeven
2023-08-24 10:07 ` Geert Uytterhoeven
2023-08-27 18:34 ` Jonathan Neuschäfer [this message]
2023-08-27 18:34 ` Jonathan Neuschäfer
2023-09-11 13:47 ` Linus Walleij
2023-09-11 13:47 ` Linus Walleij
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=ZOuXSiR9UXtK/SlV@probook \
--to=j.neuschaefer@gmx.net \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=geert+renesas@glider.be \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.