diff mbox series

[v2] mmc: renesas_sdhi: add regulator dependency

Message ID 20250329164145.3194284-1-arnd@kernel.org
State New
Headers show
Series [v2] mmc: renesas_sdhi: add regulator dependency | expand

Commit Message

Arnd Bergmann March 29, 2025, 4:41 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The driver started using the regulator subsystem and fails to build without
a dependeny on CONFIG_REGULATOR:

ERROR: modpost: "rdev_get_drvdata" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
ERROR: modpost: "devm_regulator_register" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!

The 'select RESET_CONTROLLER' needs to either go away or get changed to a dependency
in order to avoid Kconfig dependency loops here. It also turns out the the superh
version needs neither RESET_CONTROLLER nor REGULATOR, and this works because
CONFIG_OF is not set there.

Change both to a 'depends on', but add '|| OF' for the superh case.

Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mmc/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson April 7, 2025, 4:04 p.m. UTC | #1
On Sat, 29 Mar 2025 at 17:41, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The driver started using the regulator subsystem and fails to build without
> a dependeny on CONFIG_REGULATOR:
>
> ERROR: modpost: "rdev_get_drvdata" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
> ERROR: modpost: "devm_regulator_register" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
>
> The 'select RESET_CONTROLLER' needs to either go away or get changed to a dependency
> in order to avoid Kconfig dependency loops here. It also turns out the the superh
> version needs neither RESET_CONTROLLER nor REGULATOR, and this works because
> CONFIG_OF is not set there.
>
> Change both to a 'depends on', but add '|| OF' for the superh case.
>
> Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
> Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied for fixes and by fixing the typo pointed out by Geert, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index c3a9e856053b..c9e067b5ba94 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -694,8 +694,8 @@ config MMC_TMIO_CORE
>  config MMC_SDHI
>         tristate "Renesas SDHI SD/SDIO controller support"
>         depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
> +       depends on (RESET_CONTROLLER && REGULATOR) || !OF
>         select MMC_TMIO_CORE
> -       select RESET_CONTROLLER if ARCH_RENESAS
>         help
>           This provides support for the SDHI SD/SDIO controller found in
>           Renesas SuperH, ARM and ARM64 based SoCs
> --
> 2.39.5
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index c3a9e856053b..c9e067b5ba94 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -694,8 +694,8 @@  config MMC_TMIO_CORE
 config MMC_SDHI
 	tristate "Renesas SDHI SD/SDIO controller support"
 	depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
+	depends on (RESET_CONTROLLER && REGULATOR) || !OF
 	select MMC_TMIO_CORE
-	select RESET_CONTROLLER if ARCH_RENESAS
 	help
 	  This provides support for the SDHI SD/SDIO controller found in
 	  Renesas SuperH, ARM and ARM64 based SoCs