[PATCH] pinctrl: meson: sync some modify from A4

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Aug 12 03:30:49 PDT 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Returning 0 with arg=0 for disabled PIN_CONFIG_OUTPUT_ENABLE violates the pinctrl generic API and breaks debugfs dumps.
--

--- Patch [1]: [PATCH] pinctrl: meson: sync some modify from A4 ---
commit 9cd4cd52945d3531f8a1944d79a8d453a832ce33
Author: Xianwei Zhao <xianwei.zhao at amlogic.com>

pinctrl: meson: sync some modify from A4

This commit syncs fixes from A4, setting the drive strength before
enabling the output to prevent unintended drive strengths. It also modifies
PIN_CONFIG_OUTPUT_ENABLE to report the actual output enable state.

> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 18295b15ecd9d..9fc30aee96a56 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c

[ ... ]

> @@ -498,9 +498,9 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
>  		break;
>  	case PIN_CONFIG_OUTPUT_ENABLE:
>  		ret = meson_pinconf_get_output(pc, pin);
> -		if (ret <= 0)
> +		if (ret < 0)
>  			return -EINVAL;
> -		arg = 1;
> +		arg = ret;

[Severity: Medium]
The generic pinctrl API defines PIN_CONFIG_OUTPUT_ENABLE as a boolean
parameter without an argument.

When a feature is inactive or disabled, drivers are expected to return 
-EINVAL from the get callback. Because the parameter has no argument, the 
core pinctrl debugfs logic ignores the returned arg value.

By returning 0 with arg = 0 when the output is disabled, won't debugfs 
falsely report all disabled pins as having their output enabled?

Should this code still return -EINVAL when ret is 0 to avoid breaking 
debugfs output?

>  		break;
>  	case PIN_CONFIG_LEVEL:

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-sync_a4-v1-1-b7279c26e2bc@amlogic.com?part=1



More information about the linux-amlogic mailing list