Re: [PATCH] mmc: renesas_sdhi: add regulator dependency
From: Arnd Bergmann
Date: Sat Mar 29 2025 - 06:46:46 EST
On Sat, Mar 29, 2025, at 10:46, Wolfram Sang wrote:
> On Sat, Mar 29, 2025 at 09:20:52AM +0100, Arnd Bergmann wrote:
>
>> config MMC_SDHI
>> tristate "Renesas SDHI SD/SDIO controller support"
>> - depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
>> + depends on SUPERH || (ARCH_RENESAS && RESET_CONTROLLER) || COMPILE_TEST
>> + depends on REGULATOR
>
> Hmm, this is too strict IMO. SuperH does not need REGULATOR.
I haven't tried building on sh, but I don't see why it wouldn't
need the regulator dependency. The code that calls it is
rcfg.of_node = of_get_child_by_name(dev->of_node, "vqmmc-regulator");
if (!of_device_is_available(rcfg.of_node)) {
of_node_put(rcfg.of_node);
rcfg.of_node = NULL;
}
if (rcfg.of_node) {
rcfg.driver_data = priv->host;
rdev = devm_regulator_register(dev, &renesas_sdhi_vqmmc_regulator, &rcfg);
...
which sounds like regulators are always needed when
of_get_child_by_name() may return a non-NULL pointer, i.e.
when CONFIG_OF is enabled.
If this is correct, maybe this is the best variant:
config MMC_SDHI
tristate "Renesas SDHI SD/SDIO controller support"
depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
depends on (REGULATOR && RESET_CONTROLLER) || !OF
CONFIG_ARCH_RENESAS is only set when CONFIG_OF is also set,
so both subsystem dependencies are covered by that, while
SUPERH doesn't currently enable OF, but will need the
regulator and reset controller if that patch is ever merged.
Arnd