[PATCH v2 1/2] pxamci: remove the ifdef CONFIG_REGULATOR

STALE5599d

2 messages, 2 authors, 2011-05-11 · open the first message on its own page

[PATCH v2 1/2] pxamci: remove the ifdef CONFIG_REGULATOR

From: Chris Ball <hidden>
Date: 2011-05-11 14:41:43

Hi Antonio,

On Wed, May 11 2011, Antonio Ospite wrote:
quoted hunk
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 <redacted>
---

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 ?
Thanks, I've merged this and squashed the 2/2 punctuation patch into it;
it didn't seem worth having a separate patch when both touch the same code.

- Chris.
-- 
Chris Ball   [off-list ref]   <http://printf.net/>
One Laptop Per Child

[PATCH v2 1/2] pxamci: remove the ifdef CONFIG_REGULATOR

From: Antonio Ospite <hidden>
Date: 2011-05-11 20:19:14

On Wed, 11 May 2011 10:41:43 -0400
Chris Ball [off-list ref] wrote:
On Wed, May 11 2011, Antonio Ospite wrote:
[...]
quoted
 drivers/mmc/host/pxamci.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
[...]
Thanks, I've merged this and squashed the 2/2 punctuation patch into it;
it didn't seem worth having a separate patch when both touch the same code.
That's perfectly fine with me.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110511/260c91c5/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help