]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: realtek: Fix return value and silence log for unsupported configs
authorTzuyi Chang <tychang@realtek.com>
Fri, 6 Mar 2026 07:52:32 +0000 (15:52 +0800)
committerLinus Walleij <linusw@kernel.org>
Tue, 10 Mar 2026 09:25:19 +0000 (10:25 +0100)
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@oss.qualcomm.com>
Signed-off-by: Tzuyi Chang <tychang@realtek.com>
Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/realtek/pinctrl-rtd.c

index eafa0d7bb19d1227551c79c83e5f98fe04df5ee5..41e7f5c2bf741014ced0639c19c237e61f2bf92b 100644 (file)
@@ -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);