From: Antonio Ospite <ospite@studenti.unina.it>
To: linux-mmc@vger.kernel.org
Cc: openezx-devel@lists.openezx.org, Chris Ball <cjb@laptop.org>,
Antonio Ospite <ospite@studenti.unina.it>,
linux-arm-kernel@lists.infradead.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH v2 1/2] pxamci: remove the ifdef CONFIG_REGULATOR
Date: Wed, 11 May 2011 12:19:05 +0200 [thread overview]
Message-ID: <1305109145-16567-1-git-send-email-ospite@studenti.unina.it> (raw)
In-Reply-To: <20110510203629.GB8726@opensource.wolfsonmicro.com>
Don't wrap regulator_get() inside an ifdef CONFIG_REGULATOR anymore, as
now it degenerates and returns NULL when the regulator framework is
disabled (since commit be1a50d: regulator: Let drivers know when they
use the stub API); and use IS_ERR_OR_NULL() to handle the stub function
correctly.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
Changes since v1:
- Use IS_ERR_OR_NULL() to correctly handle the stub regulator_get()
- Put the short commit message of be1a50d so it is easier to see what it is
about, for the long commit and the actual code changes the git history can
be queried.
Thanks,
Antonio Ospite
http://ao2.it
drivers/mmc/host/pxamci.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 7257738..3a89fb2 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -79,10 +79,9 @@ struct pxamci_host {
static inline void pxamci_init_ocr(struct pxamci_host *host)
{
-#ifdef CONFIG_REGULATOR
host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc");
- if (IS_ERR(host->vcc))
+ if (IS_ERR_OR_NULL(host->vcc))
host->vcc = NULL;
else {
host->mmc->ocr_avail = mmc_regulator_get_ocrmask(host->vcc);
@@ -90,7 +89,7 @@ static inline void pxamci_init_ocr(struct pxamci_host *host)
dev_warn(mmc_dev(host->mmc),
"ocr_mask/setpower will not be used\n");
}
-#endif
+
if (host->vcc == NULL) {
/* fall-back to platform data */
host->mmc->ocr_avail = host->pdata ?
--
1.7.5.1
next prev parent reply other threads:[~2011-05-11 10:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 20:11 [PATCH] pxamci: remove an ifdef about CONFIG_REGULATOR Antonio Ospite
2011-05-09 20:15 ` Mark Brown
2011-05-09 20:23 ` Russell King - ARM Linux
2011-05-09 20:36 ` Mark Brown
2011-05-10 20:02 ` Antonio Ospite
2011-05-10 20:32 ` Russell King - ARM Linux
2011-05-10 20:36 ` Mark Brown
2011-05-11 10:19 ` Antonio Ospite [this message]
2011-05-11 13:07 ` [PATCH v2 1/2] pxamci: remove the ifdef CONFIG_REGULATOR Mark Brown
2011-05-11 14:41 ` Chris Ball
2011-05-11 20:19 ` Antonio Ospite
2011-05-11 10:19 ` [PATCH 2/2] pxamci: fix coding style for multi statement conditionals Antonio Ospite
2011-05-11 10:26 ` [PATCH] pxamci: remove an ifdef about CONFIG_REGULATOR Antonio Ospite
2011-05-10 11:59 ` Sergei Shtylyov
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=1305109145-16567-1-git-send-email-ospite@studenti.unina.it \
--to=ospite@studenti.unina.it \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cjb@laptop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=openezx-devel@lists.openezx.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;
as well as URLs for NNTP newsgroup(s).