linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: renesas: rza1: Make mux_conf const in rza1_pin_mux_single()
@ 2025-08-14  9:50 Geert Uytterhoeven
  2025-08-14 10:06 ` Niklas Söderlund
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2025-08-14  9:50 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: linux-renesas-soc, linux-gpio, Geert Uytterhoeven

The rza1_mux_conf object pointed to by the mux_conf parameter of
rza1_pin_mux_single() is never modified.  Make it const.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This has a small conflict with "[PATCH v4 09/15] pinctrl: constify
pinmux_generic_get_function()"[1], which I have already acked.
Perhaps the best solution is for Bartosz to include this in his series?
Or I can resend an updated version for LinusW to apply after Bartosz
series has handled?

Thanks!

[1] https://lore.kernel.org/all/20250812-pinctrl-gpio-pinfuncs-v4-9-bb3906c55e64@linaro.org/

 drivers/pinctrl/renesas/pinctrl-rza1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c
index 23812116ef42682d..4613d2c8cccc1dab 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
@@ -669,7 +669,7 @@ static inline int rza1_pin_get(struct rza1_port *port, unsigned int pin)
  * @mux_conf: pin multiplexing descriptor
  */
 static int rza1_pin_mux_single(struct rza1_pinctrl *rza1_pctl,
-			       struct rza1_mux_conf *mux_conf)
+			       const struct rza1_mux_conf *mux_conf)
 {
 	struct rza1_port *port = &rza1_pctl->ports[mux_conf->port];
 	unsigned int pin = mux_conf->pin;
@@ -1119,7 +1119,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
 			   unsigned int group)
 {
 	struct rza1_pinctrl *rza1_pctl = pinctrl_dev_get_drvdata(pctldev);
-	struct rza1_mux_conf *mux_confs;
+	const struct rza1_mux_conf *mux_confs;
 	struct function_desc *func;
 	struct group_desc *grp;
 	int i;
@@ -1132,7 +1132,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
 	if (!func)
 		return -EINVAL;
 
-	mux_confs = (struct rza1_mux_conf *)func->data;
+	mux_confs = (const struct rza1_mux_conf *)func->data;
 	for (i = 0; i < grp->grp.npins; ++i) {
 		int ret;
 
-- 
2.43.0


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

* Re: [PATCH] pinctrl: renesas: rza1: Make mux_conf const in rza1_pin_mux_single()
  2025-08-14  9:50 [PATCH] pinctrl: renesas: rza1: Make mux_conf const in rza1_pin_mux_single() Geert Uytterhoeven
@ 2025-08-14 10:06 ` Niklas Söderlund
  0 siblings, 0 replies; 2+ messages in thread
From: Niklas Söderlund @ 2025-08-14 10:06 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Bartosz Golaszewski, linux-renesas-soc, linux-gpio

Hi Geert,

Thanks for your work.

On 2025-08-14 11:50:55 +0200, Geert Uytterhoeven wrote:
> The rza1_mux_conf object pointed to by the mux_conf parameter of
> rza1_pin_mux_single() is never modified.  Make it const.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

I like improvements like this!

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
> This has a small conflict with "[PATCH v4 09/15] pinctrl: constify
> pinmux_generic_get_function()"[1], which I have already acked.
> Perhaps the best solution is for Bartosz to include this in his series?
> Or I can resend an updated version for LinusW to apply after Bartosz
> series has handled?
> 
> Thanks!
> 
> [1] https://lore.kernel.org/all/20250812-pinctrl-gpio-pinfuncs-v4-9-bb3906c55e64@linaro.org/
> 
>  drivers/pinctrl/renesas/pinctrl-rza1.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c
> index 23812116ef42682d..4613d2c8cccc1dab 100644
> --- a/drivers/pinctrl/renesas/pinctrl-rza1.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
> @@ -669,7 +669,7 @@ static inline int rza1_pin_get(struct rza1_port *port, unsigned int pin)
>   * @mux_conf: pin multiplexing descriptor
>   */
>  static int rza1_pin_mux_single(struct rza1_pinctrl *rza1_pctl,
> -			       struct rza1_mux_conf *mux_conf)
> +			       const struct rza1_mux_conf *mux_conf)
>  {
>  	struct rza1_port *port = &rza1_pctl->ports[mux_conf->port];
>  	unsigned int pin = mux_conf->pin;
> @@ -1119,7 +1119,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
>  			   unsigned int group)
>  {
>  	struct rza1_pinctrl *rza1_pctl = pinctrl_dev_get_drvdata(pctldev);
> -	struct rza1_mux_conf *mux_confs;
> +	const struct rza1_mux_conf *mux_confs;
>  	struct function_desc *func;
>  	struct group_desc *grp;
>  	int i;
> @@ -1132,7 +1132,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
>  	if (!func)
>  		return -EINVAL;
>  
> -	mux_confs = (struct rza1_mux_conf *)func->data;
> +	mux_confs = (const struct rza1_mux_conf *)func->data;
>  	for (i = 0; i < grp->grp.npins; ++i) {
>  		int ret;
>  
> -- 
> 2.43.0
> 
> 

-- 
Kind Regards,
Niklas Söderlund

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

end of thread, other threads:[~2025-08-14 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14  9:50 [PATCH] pinctrl: renesas: rza1: Make mux_conf const in rza1_pin_mux_single() Geert Uytterhoeven
2025-08-14 10:06 ` Niklas Söderlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).