mmc: sdhci: Conditionalize regulator_get() on CONFIG_REGULATOR
PATCH 1/1 mmc: sdhci: Conditionalize regulator_get() on CONFIG_REGULATOR
The regulator subsystem provides stubbed out versions of its calls that are always present (so that they can be used without needing #ifdefs). But the regulator_get() stub always returns an error value according to IS_ERR(), which leads sdhci to print messages like "mmc0: no vmmc regulator found" on every boot, even if CONFIG_REGULATOR is not set.
This patch fixes that (and removes the unwanted message) by having the regulator_get() call occur inside an #ifdef CONFIG_REGULATOR.
--- drivers/mmc/host/sdhci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci.c +2 -0
@@ -2059,15 +2059,17 @@ int sdhci_add_host(struct sdhci_host *host) mmc_hostname(mmc), host);if (ret) goto untasklet; +#ifdef CONFIG_REGULATOR host->vmmc =regulator_get (mmc_dev (mmc),"vmmc" );if (IS_ERR (host->vmmc)) {printk (KERN_INFO "%s: no vmmc regulator found\n" ,mmc_hostname (mmc)); host->vmmc =NULL ; }else {regulator_enable (host->vmmc); } +#endif /* CONFIG_REGULATOR */ sdhci_init (host,0 );#ifdef CONFIG_MMC_DEBUG
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
Quoted 8 lines · Chris Ball
The regulator subsystem provides stubbed out versions of its calls that are always present (so that they can be used without needing #ifdefs). But the
regulator_get()stub always returns an error value according toIS_ERR(), which leads sdhci to print messages like "mmc0: no vmmc regulator found" on every boot, even ifCONFIG_REGULATORis not set.This patch fixes that (and removes the unwanted message) by having the
regulator_get()call occur inside an #ifdefCONFIG_REGULATOR.
Shouldn't the stubbed version of regulator_get return NULL, which is not treated as an error by IS_ERR?
- Lars
Hi Lars,
Quoted 7 lines · Lars-Peter Clausen
Quoted 6 lines · Chris Ball
The regulator subsystem provides stubbed out versions of its calls that are always present (so that they can be used without needing #ifdefs). But the
regulator_get()stub always returns an error value according toIS_ERR(), which leads sdhci to print messages like "mmc0: no vmmc regulator found" on every boot, even ifCONFIG_REGULATORis not set.
Quoted 5 lines
Quoted 2 lines
This patch fixes that (and removes the unwanted message) by having the
regulator_get()call occur inside an #ifdefCONFIG_REGULATOR.Shouldn't the stubbed version of
regulator_getreturn NULL, which is not treated as an error byIS_ERR?
Oops, thanks -- you're right, of course. I withdraw the patch.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child