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

Previous thread: [PATCH] serial: amba-pl010: fix set_ldisc by Mika Westerberg on Sunday, August 29, 2010 - 10:12 am. (4 messages)

Next thread: Linux 2.6.36-rc3 by Linus Torvalds on Sunday, August 29, 2010 - 10:25 am. (28 messages)
From: Linus Walleij
Date: Sunday, August 29, 2010 - 10:15 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: 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: Mark Brown <broonie@opensource.wolfsonmicro.com>
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: Bengt Jonsson <bengt.jonsson@stericsson.com>
Cc: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
This is not the final movement of regulator code into the
MMC framework by a long shot, but it's atleast a starter.
If you like it, ACK it.

It's not easy for me to test this code since both the OMAP2 and
PXA3XX defconfigs have (unrelated) build failures on the current
-next tree, however the U300 builds fine and seems to work nicely,
I'll stress-test it a bit more though.
---
 drivers/mmc/core/core.c       |   38 +++++++++++++++++++++++++++++---------
 drivers/mmc/host/mmci.c       |   21 +++++++++++++--------
 drivers/mmc/host/omap_hsmmc.c |   32 ++++++++++++++++++++++----------
 drivers/mmc/host/pxamci.c     |   24 ++++++++++++++++++------
 include/linux/mmc/host.h      |    8 +++++++-
 5 files changed, 89 insertions(+), 34 deletions(-)

diff ...
From: Adrian Hunter
Date: Monday, August 30, 2010 - 1:52 pm

mmc_power_off() does set ios->vdd to 0 so the original code was fine

--

From: Linus Walleij
Date: Tuesday, August 31, 2010 - 7:35 am

Yeah I know. This bit was to increase readability, explicitly showing
the power state like this makes it more clear what is happening I think.

The rest of the comments are fixed, new patch soon.

Yours,
Linus Walleij
--

From: Mark Brown
Date: Tuesday, August 31, 2010 - 5:22 am

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


It'd be nice to display the error code as well.  I do tend to agree with
Adrian that it might be nice to have the noop functions in the header to
allow the optimiser to play with them as well but it's unlikely to be a
big deal.
--

Previous thread: [PATCH] serial: amba-pl010: fix set_ldisc by Mika Westerberg on Sunday, August 29, 2010 - 10:12 am. (4 messages)

Next thread: Linux 2.6.36-rc3 by Linus Torvalds on Sunday, August 29, 2010 - 10:25 am. (28 messages)