[PATCH v2 02/14] pinctrl: realtek: Fix return value and silence log for unsupported configs

From: Yu-Chun Lin

Date: Fri Mar 06 2026 - 02:56:11 EST


From: Tzuyi Chang <tychang@xxxxxxxxxxx>

Treating unsupported configurations as errors causes upper layers (like the
GPIO subsystem) to interpret optional features as hard failures, aborting
operations or printing unnecessary error logs.

For example, during gpiod_get(), the GPIO framework attempts to set
PIN_CONFIG_PERSIST_STATE. Since this driver does not support it, false
error reports are generated in dmesg.

Fix this by returning -ENOTSUPP and demoting the log level to dev_dbg.

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
Signed-off-by: Tzuyi Chang <tychang@xxxxxxxxxxx>
Signed-off-by: Yu-Chun Lin <eleanor.lin@xxxxxxxxxxx>
---
Changes in v2:
- Add Bartosz's Reviewed-by tag.

drivers/pinctrl/realtek/pinctrl-rtd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c
index eafa0d7bb19d..41e7f5c2bf74 100644
--- a/drivers/pinctrl/realtek/pinctrl-rtd.c
+++ b/drivers/pinctrl/realtek/pinctrl-rtd.c
@@ -456,8 +456,8 @@ static int rtd_pconf_parse_conf(struct rtd_pinctrl *data,
break;

default:
- dev_err(data->dev, "unsupported pinconf: %d\n", (u32)param);
- return -EINVAL;
+ dev_dbg(data->dev, "unsupported pinconf: %d\n", (u32)param);
+ return -ENOTSUPP;
}

ret = regmap_update_bits(data->regmap_pinctrl, reg_off, mask, val);
--
2.34.1