[PATCH] MMC: move regulator handling closer to core v2

Previous thread: Re: [PATCH] USB: output an error message when the pipe type doesn't match the endpoint type by Alan Stern on Tuesday, August 31, 2010 - 7:16 am. (2 messages)

Next thread: [PATCH v4 1/2] init: add sys-wrapper.h by Namhyung Kim on Tuesday, August 31, 2010 - 8:30 am. (4 messages)
From: Linus Walleij
Date: Tuesday, August 31, 2010 - 8:26 am

After discovering a problem in regulator reference counting I
took Mark Brown's advice to move the reference count into the
MMC core by making the regulator status a member of
struct mmc_host.

I took this opportunity to also implement NULL versions of
the regulator functions so as to rid the driver code from
some ugly #ifdef CONFIG_REGULATOR clauses.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Sundar Iyer <sundar.iyer@stericsson.com>
Cc: Daniel Mack <daniel@caiaq.de>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Matt Fleming <matt@console-pimps.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Cliff Brake <cbrake@bec-systems.com>
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
Changes V1->V2:
- Moved #ifdef:ed out regulator code to core.h header
- Moved error print into the core regulator code
---
 drivers/mmc/core/core.c       |   26 ++++++++++++++++----------
 drivers/mmc/host/mmci.c       |   11 ++++-------
 drivers/mmc/host/omap_hsmmc.c |   21 +++++++++++++--------
 drivers/mmc/host/pxamci.c     |   18 ++++++++++++------
 include/linux/mmc/host.h      |   22 +++++++++++++++++++++-
 5 files changed, 66 insertions(+), 32 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5db49b1..2d47467 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -771,8 +771,9 @@ EXPORT_SYMBOL(mmc_regulator_get_ocrmask);
 
 /**
  * mmc_regulator_set_ocr - set regulator to match host->ios voltage
- * @vdd_bit: zero for power off, else ...
From: Linus Walleij
Date: Friday, September 3, 2010 - 12:38 pm

This has an Reveiwed-by from the regulator maintainer and
seems to address all comments, noone is objection so Andrew
can you pick it up?

Yours,
Linus Walleij
--

From: Adrian Hunter
Date: Friday, September 3, 2010 - 11:10 pm

One of our contractors had a look at the patch and had this comment:

One comment/question:
/host/mmci.c in function
"static int __devexit mmci_remove(struct amba_device *dev)" there is code:
         if (regulator_is_enabled(host->vcc))
             regulator_disable(host->vcc);

--

From: Linus Walleij
Date: Sunday, September 5, 2010 - 2:05 am

Good catch!

Since it's in the remove() we can't do much about the return value from that
call but we should sure use the _set_ocr() so fixed it and pushed v3.

Yours,
Linus Walleij
--

From: Mark Brown
Date: Sunday, September 5, 2010 - 1:48 am

Just to clarify, I'm only one of the regulator maintainers - Liam also
maintains the regulator API.
--

Previous thread: Re: [PATCH] USB: output an error message when the pipe type doesn't match the endpoint type by Alan Stern on Tuesday, August 31, 2010 - 7:16 am. (2 messages)

Next thread: [PATCH v4 1/2] init: add sys-wrapper.h by Namhyung Kim on Tuesday, August 31, 2010 - 8:30 am. (4 messages)