Re: [PATCH] pinctrl: renesas: rza1: Make mux_conf const in rza1_pin_mux_single()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

I like improvements like this!

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

> ---
> 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@xxxxxxxxxx/
> 
>  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




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux