summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-12-27 16:37:11 -0600
committerTom Rini <trini@konsulko.com>2026-01-09 09:08:14 -0600
commit217cf656e249f698d390a7d8eaf255eb1a6c0230 (patch)
tree517b0cbaabb08056ff41b7e2d9699ce58ae7880f /drivers/pinctrl
parent284e1a00f4f28dcd6ddc8c860d22f1c8c427c5d5 (diff)
dm: core: Default to using DEVRES outside of xPL
The devm alloc functions that we have may follow the Linux kernel model where allocations are (almost always) automatically free()'d. However, quite often we don't enable, in full U-Boot, the tracking and free()'ing functionality. This in turn leads to memory leaks because the driver author expects that since the functions have the same name as in the Linux Kernel they have the same behavior. In turn we then get functionally correct commits such as commit 00e1fed93c8c ("firmware: ti_sci: Fix memory leaks in devm_ti_sci_get_of_resource") that manually add these calls. Rather than manually tracking allocations and implementing free()s, rework things so that we follow expectations by enabling the DEVRES functionality (outside of xPL phases). This turns DEVRES from a prompted symbol to a symbol that must be select'd, and we now remove our non-managed alloc/free functions from outside of xPL builds. Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/Kconfig1
-rw-r--r--drivers/pinctrl/mscc/Kconfig1
-rw-r--r--drivers/pinctrl/mvebu/Kconfig1
-rw-r--r--drivers/pinctrl/renesas/Kconfig1
4 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 48119694031..ea90713ec6c 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -294,6 +294,7 @@ config PINCTRL_SANDBOX
config PINCTRL_SINGLE
bool "Single register pin-control and pin-multiplex driver"
depends on DM
+ select DEVRES
help
This enables pinctrl driver for systems using a single register for
pin configuration and multiplexing. TI's AM335X SoCs are examples of
diff --git a/drivers/pinctrl/mscc/Kconfig b/drivers/pinctrl/mscc/Kconfig
index aab67fabd2c..567c93f404c 100644
--- a/drivers/pinctrl/mscc/Kconfig
+++ b/drivers/pinctrl/mscc/Kconfig
@@ -2,6 +2,7 @@
config PINCTRL_MSCC
bool
+ select DEVRES
config PINCTRL_MSCC_OCELOT
depends on SOC_OCELOT && PINCTRL_FULL && OF_CONTROL
diff --git a/drivers/pinctrl/mvebu/Kconfig b/drivers/pinctrl/mvebu/Kconfig
index 7c51d138c8b..10ba440f246 100644
--- a/drivers/pinctrl/mvebu/Kconfig
+++ b/drivers/pinctrl/mvebu/Kconfig
@@ -9,6 +9,7 @@ config PINCTRL_ARMADA_38X
config PINCTRL_ARMADA_37XX
depends on ARMADA_3700 && PINCTRL_FULL
+ select DEVRES
bool "Armada 37xx pin control driver"
help
Support pin multiplexing and pin configuration control on
diff --git a/drivers/pinctrl/renesas/Kconfig b/drivers/pinctrl/renesas/Kconfig
index ac40b31dbfa..171da88cfcf 100644
--- a/drivers/pinctrl/renesas/Kconfig
+++ b/drivers/pinctrl/renesas/Kconfig
@@ -166,6 +166,7 @@ config PINCTRL_RZG2L
depends on PINCTRL
depends on PINCTRL_GENERIC
depends on PINCONF
+ select DEVRES
help
Support the pinctrl functionality of the pin function controller (PFC)
on the Renesas RZ/G2L SoC family.