Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: realtek: Fix return value and silence log for unsupported configs

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>

authored by

Tzuyi Chang and committed by
Linus Walleij
6a6b238c a248904e

+2 -2
+2 -2
drivers/pinctrl/realtek/pinctrl-rtd.c
··· 456 456 break; 457 457 458 458 default: 459 - dev_err(data->dev, "unsupported pinconf: %d\n", (u32)param); 460 - return -EINVAL; 459 + dev_dbg(data->dev, "unsupported pinconf: %d\n", (u32)param); 460 + return -ENOTSUPP; 461 461 } 462 462 463 463 ret = regmap_update_bits(data->regmap_pinctrl, reg_off, mask, val);