[PATCH u-boot-marvell 3/3] arm64: a37xx: pinctrl: Improve description for pinmux command

Stefan Roese sr at denx.de
Tue Aug 9 13:35:56 CEST 2022


On 04.08.22 12:41, Pali Rohár wrote:
> In more cases group name consist of function name followed by function
> number. So if function name is just prefix of group name, show group name.
> 
> So in 'pinmux status -a' command output would be visible also extended
> function number, which is useful for debugging.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> index 32b49f167c66..25fbe39abd19 100644
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> @@ -406,7 +406,17 @@ static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int sele
>   
>   			for (f = 0; f < NB_FUNCS && grp->funcs[f]; f++) {
>   				if (grp->val[f] == val) {
> -					strlcpy(buf, grp->funcs[f], size);
> +					/*
> +					 * In more cases group name consist of
> +					 * function name followed by function
> +					 * number. So if function name is just
> +					 * prefix of group name, show group name.
> +					 */
> +					if (strncmp(grp->name, grp->funcs[f],
> +						    strlen(grp->funcs[f])) == 0)
> +						strlcpy(buf, grp->name, size);
> +					else
> +						strlcpy(buf, grp->funcs[f], size);
>   					return 0;
>   				}
>   			}

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list