diff mbox series

[v2] mmc: host: Kconfig: Fix undefined reference to rdev_get_drvdata()

Message ID 20250329080036.49170-1-biju.das.jz@bp.renesas.com (mailing list archive)
State New
Delegated to: Geert Uytterhoeven
Headers show
Series [v2] mmc: host: Kconfig: Fix undefined reference to rdev_get_drvdata() | expand

Commit Message

Biju Das March 29, 2025, 8 a.m. UTC
The driver no longer builds when regulator support is unavailable. Fix
the build error undefined reference to rdev_get_drvdata() by selecting the
REGULATOR in config MMC_SDHI.

Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503290554.zASQT70Q-lkp@intel.com/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Added 'if ARCH_RENESAS' to leave SUPERH out
---
 drivers/mmc/host/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Arnd Bergmann March 29, 2025, 8:20 a.m. UTC | #1
On Sat, Mar 29, 2025, at 09:00, Biju Das wrote:
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 6824131b69b1..f62e436b1d4f 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -692,6 +692,7 @@ config MMC_SDHI
>  	tristate "Renesas SDHI SD/SDIO controller support"
>  	depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
>  	select MMC_TMIO_CORE
> +	select REGULATOR if ARCH_RENESAS
>  	select RESET_CONTROLLER if ARCH_RENESAS

You should never 'select' another subsystem from a device
driver, that just causes circular dependencies leads to
unintended effects when a subsystem suddenly gets turned on
during 'make oldconfig' or 'make defconfig' when it should
have remained disabled.

I see that I forgot to send a patch I made when the problem
showed up two weeks ago, I'll send my patch.

       Arnd
Geert Uytterhoeven March 31, 2025, 9:19 a.m. UTC | #2
Hi Biju,

On Sat, 29 Mar 2025 at 09:00, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> The driver no longer builds when regulator support is unavailable. Fix
> the build error undefined reference to rdev_get_drvdata() by selecting the
> REGULATOR in config MMC_SDHI.
>
> Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202503290554.zASQT70Q-lkp@intel.com/
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  * Added 'if ARCH_RENESAS' to leave SUPERH out
> ---
>  drivers/mmc/host/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 6824131b69b1..f62e436b1d4f 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -692,6 +692,7 @@ config MMC_SDHI
>         tristate "Renesas SDHI SD/SDIO controller support"
>         depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
>         select MMC_TMIO_CORE
> +       select REGULATOR if ARCH_RENESAS

Regardless of Arnd's comment, making the select optional means the
build can still break when compile-testing on a non-Reneas platform.

>         select RESET_CONTROLLER if ARCH_RENESAS
>         help
>           This provides support for the SDHI SD/SDIO controller found in

Gr{oetje,eeting}s,

                        Geert
Biju Das March 31, 2025, 9:33 a.m. UTC | #3
Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 31 March 2025 10:19
> Subject: Re: [PATCH v2] mmc: host: Kconfig: Fix undefined reference to rdev_get_drvdata()
> 
> Hi Biju,
> 
> On Sat, 29 Mar 2025 at 09:00, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > The driver no longer builds when regulator support is unavailable. Fix
> > the build error undefined reference to rdev_get_drvdata() by selecting
> > the REGULATOR in config MMC_SDHI.
> >
> > Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202503290554.zASQT70Q-lkp@intel.
> > com/
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v1->v2:
> >  * Added 'if ARCH_RENESAS' to leave SUPERH out
> > ---
> >  drivers/mmc/host/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index
> > 6824131b69b1..f62e436b1d4f 100644
> > --- a/drivers/mmc/host/Kconfig
> > +++ b/drivers/mmc/host/Kconfig
> > @@ -692,6 +692,7 @@ config MMC_SDHI
> >         tristate "Renesas SDHI SD/SDIO controller support"
> >         depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
> >         select MMC_TMIO_CORE
> > +       select REGULATOR if ARCH_RENESAS
> 
> Regardless of Arnd's comment, making the select optional means the build can still break when compile-
> testing on a non-Reneas platform.

Agreed. Looks Arnd post another patch[1] to avoid this issue.

[1]
https://lore.kernel.org/all/20250329164145.3194284-1-arnd@kernel.org/

Cheers,
Biju
diff mbox series

Patch

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 6824131b69b1..f62e436b1d4f 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -692,6 +692,7 @@  config MMC_SDHI
 	tristate "Renesas SDHI SD/SDIO controller support"
 	depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
 	select MMC_TMIO_CORE
+	select REGULATOR if ARCH_RENESAS
 	select RESET_CONTROLLER if ARCH_RENESAS
 	help
 	  This provides support for the SDHI SD/SDIO controller found in