]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
pinctrl: renesas: rzv2m: Use -ENOTSUPP instead of -EOPNOTSUPP
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Fri, 22 May 2026 10:57:17 +0000 (13:57 +0300)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 28 May 2026 13:05:18 +0000 (15:05 +0200)
commit01f94d53947df35ba77cdb3992a4e3ef9d9dc1ad
tree3f123a652758ab022ac8464695c463eb656cb827
parent60a19a68779b1f24e3160c8e4317d0334a397687
pinctrl: renesas: rzv2m: Use -ENOTSUPP instead of -EOPNOTSUPP

The pinctrl and GPIO core code make exceptions for the -ENOTSUPP error
code. One such example is gpio_set_config_with_argument_optional(), which
returns success when gpio_set_config_with_argument() returns -ENOTSUPP, but
reports failure for all other error codes.

Returning -EOPNOTSUPP from the pinctrl driver on the unsupported pinctrl
operation may lead to boot failures when pinctrl drivers implements
struct gpio_chip::set_config, the system uses GPIO hogs, and the
struct gpio_chip::set_config implementation returns -EOPNOTSUPP for the
unsupported operations.

Currently, the driver does not implement struct gpio_chip::set_config().
To avoid future failures, return -ENOTSUPP from
rzv2m_pinctrl_pinconf_set().

rzv2m_pinctrl_pinconf_group_get() is used when dumping pinctrl
configuration. pinconf_generic_dump_one(), which calls it, makes
exceptions for the -EINVAL and -ENOTSUPP error codes. The documentation
for struct pinconf_ops::pin_config_group_get states that it "should
return -ENOTSUPP and -EINVAL using the same rules as pin_config_get()".
The documentation for struct pinconf_ops::pin_config_get states:

"get the config of a certain pin, if the requested config is not available
on this controller this should return -ENOTSUPP and if it is available but
disabled it should return -EINVAL".

Return -ENOTSUPP for the unsupported pinctrl operation.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260522105717.1727837-1-claudiu.beznea@kernel.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl-rzv2m.c