From: Vikrant Yadav <vikrantyadav4802@gmail.com>
To: lorenzo@kernel.org, linusw@kernel.org
Cc: linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vikrant Yadav <vikrantyadav4802@gmail.com>
Subject: [PATCH] pinctrl: airoha: fix bias readback in airoha_pinconf_get()
Date: Fri, 23 Oct 2026 23:27:10 +0530 [thread overview]
Message-ID: <20261023175710.19181-1-vikrantyadav4802@gmail.com> (raw)
In airoha_pinconf_get(), the last branch of bias check
"else if (pull_up || pull_down)", has no check on the requested
parameter. It was meant to reject PIN_CONFIG_BIAS_DISABLE when a pull
is enabled, but it also runs for PIN_CONFIG_BIAS_PULL_UP and
PIN_CONFIG_BIAS_PULL_DOWN. When the pin really has that pull set, the
earlier PULL_UP/PULL_DOWN checks do not reject it, so the execution
reaches this branch, which returns -EINVAL. Reading back a pull-up or
pull-down therefore always fails.
Signed-off-by: Vikrant Yadav <vikrantyadav4802@gmail.com>
---
drivers/pinctrl/airoha/pinctrl-airoha.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
index f505a3f69c5d..8cf4592cbc73 100644
--- a/drivers/pinctrl/airoha/pinctrl-airoha.c
+++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
@@ -554,7 +554,7 @@ static int airoha_pinconf_get(struct pinctrl_dev *pctrl_dev,
else if (param == PIN_CONFIG_BIAS_PULL_DOWN &&
!(pull_down && !pull_up))
return -EINVAL;
- else if (pull_up || pull_down)
+ else if (param == PIN_CONFIG_BIAS_DISABLE && (pull_up || pull_down))
return -EINVAL;
arg = 1;
--
2.34.1
reply other threads:[~2026-10-23 17:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261023175710.19181-1-vikrantyadav4802@gmail.com \
--to=vikrantyadav4802@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lorenzo@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®