Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: linux-mmc@vger.kernel.org
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Subject: [PATCH] mmc: sdhci: Conditionalize regulator_get() on CONFIG_REGULATOR
Date: Sat, 30 Apr 2011 00:35:59 -0400	[thread overview]
Message-ID: <m3r58k1hlc.fsf@pullcord.laptop.org> (raw)

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.

Reported-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
 drivers/mmc/host/sdhci.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index e5cfe70..e29e77a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

             reply	other threads:[~2011-04-30  4:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30  4:35 Chris Ball [this message]
2011-04-30 15:06 ` [PATCH] mmc: sdhci: Conditionalize regulator_get() on CONFIG_REGULATOR Lars-Peter Clausen
2011-04-30 16:03   ` Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3r58k1hlc.fsf@pullcord.laptop.org \
    --to=cjb@laptop.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox