[PATCH] pinctrl: fix PINCTRL_SPPCTL=m
From: Julian Braha <julianbraha@gmail.com>
Date: 2026-09-04 12:18:39
Also in:
linux-gpio, lkml
Subsystem:
arm port, pin control subsystem, pin controller - sunplus / tibbo, the rest · Maintainers:
Russell King, Linus Walleij, Dvorkin Dmitry, Wells Lu, Linus Torvalds
The PINCTRL_SPPCTL option is defined as a tristate in Kconfig, and the
help text suggests that the user can build it as a module by setting to
'm'.
However, it cannot currently be set to 'm', because SOC_SP7021, the only
platform that supports it, is a bool option that uses 'select' on it.
To allow users to actually set PINCTRL_SPPCTL=m, let's remove the select
from the SOC_SP7021 option, and instead have PINCTRL_SPPCTL default to y
when SOC_SP7021=y, then users can configure PINCTRL_SPPCTL=m in the
kconfig frontend if desired.
Note that I have only compile-tested this change, since I do not have the
hardware to runtime-test it. Please advise if it would be better to change
PINCTRL_SPPCTL to 'bool' and remove the help text suggesting that it can
be set to 'm'.
This impossible tristate was detected by kconfirm, a static analysis tool
for Kconfig.
Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021")
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
arch/arm/Kconfig.platforms | 1 -
drivers/pinctrl/sunplus/Kconfig | 3 ++-
drivers/pinctrl/sunplus/sppctl.c | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig.platforms b/arch/arm/Kconfig.platforms
index 2e118b65f93b..dc880addadc5 100644
--- a/arch/arm/Kconfig.platforms
+++ b/arch/arm/Kconfig.platforms@@ -177,7 +177,6 @@ config SOC_SP7021 select ARM_GIC select ARM_PSCI select PINCTRL - select PINCTRL_SPPCTL select SERIAL_SUNPLUS if TTY select SERIAL_SUNPLUS_CONSOLE if TTY help
diff --git a/drivers/pinctrl/sunplus/Kconfig b/drivers/pinctrl/sunplus/Kconfig
index 69f82590f6d2..7719838b39b6 100644
--- a/drivers/pinctrl/sunplus/Kconfig
+++ b/drivers/pinctrl/sunplus/Kconfig@@ -5,7 +5,8 @@ config PINCTRL_SPPCTL tristate "Sunplus SP7021 PinMux and GPIO driver" - depends on SOC_SP7021 + default SOC_SP7021 + depends on SOC_SP7021 || COMPILE_TEST depends on OF && HAS_IOMEM select GENERIC_PINCTRL_GROUPS select GENERIC_PINMUX_FUNCTIONS
diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c
index 67e036d66245..89c6e2e92f07 100644
--- a/drivers/pinctrl/sunplus/sppctl.c
+++ b/drivers/pinctrl/sunplus/sppctl.c@@ -1113,6 +1113,7 @@ static const struct of_device_id sppctl_match_table[] = { { .compatible = "sunplus,sp7021-pctl" }, { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, sppctl_match_table); static struct platform_driver sppctl_pinctrl_driver = { .driver = {
@@ -1121,7 +1122,7 @@ static struct platform_driver sppctl_pinctrl_driver = { }, .probe = sppctl_probe, }; -builtin_platform_driver(sppctl_pinctrl_driver) +module_platform_driver(sppctl_pinctrl_driver); MODULE_AUTHOR("Dvorkin Dmitry <dvorkin@tibbo.com>"); MODULE_AUTHOR("Wells Lu <wellslutw@gmail.com>");
--
2.55.0