All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops
@ 2010-05-11 21:57 Kevin Hilman
  2010-05-13 18:48 ` Matt Fleming
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2010-05-11 21:57 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-omap, Madhusudhan Chikkature, Adrian Hunter, Andrew Morton,
	Matt Fleming, Tony Lindgren, Denis Karpov, linux-kernel

Convert PM operations to use dev_pm_ops.  This will facilitate
the runtime PM coversion which will add to dev_pm_ops hooks.

Note that dev_pm_ops version of the suspend hook no longer takes a
'state' argument.  However, the MMC core function mmc_suspend_host()
still takes a 'state' argument, but it is unused, so a dummy
state variable was created to pass to the MMC core.

In the future, the MMC core should be converted to drop this
state argument and the rest of the MMC drivers could be easily
converted to dev_pm_ops as well.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
Applies on v2.6.34-rc6

 drivers/mmc/host/omap_hsmmc.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e9caf69..8112d54 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2258,10 +2258,12 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int omap_hsmmc_suspend(struct platform_device *pdev, pm_message_t state)
+static int omap_hsmmc_suspend(struct device *dev)
 {
 	int ret = 0;
+	struct platform_device *pdev = to_platform_device(dev);
 	struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
+	pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
 
 	if (host && host->suspended)
 		return 0;
@@ -2310,9 +2312,10 @@ static int omap_hsmmc_suspend(struct platform_device *pdev, pm_message_t state)
 }
 
 /* Routine to resume the MMC device */
-static int omap_hsmmc_resume(struct platform_device *pdev)
+static int omap_hsmmc_resume(struct device *dev)
 {
 	int ret = 0;
+	struct platform_device *pdev = to_platform_device(dev);
 	struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
 
 	if (host && !host->suspended)
@@ -2363,13 +2366,17 @@ clk_en_err:
 #define omap_hsmmc_resume		NULL
 #endif
 
-static struct platform_driver omap_hsmmc_driver = {
-	.remove		= omap_hsmmc_remove,
+static struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
 	.suspend	= omap_hsmmc_suspend,
 	.resume		= omap_hsmmc_resume,
+};
+
+static struct platform_driver omap_hsmmc_driver = {
+	.remove		= omap_hsmmc_remove,
 	.driver		= {
 		.name = DRIVER_NAME,
 		.owner = THIS_MODULE,
+		.pm = &omap_hsmmc_dev_pm_ops,
 	},
 };
 
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops
  2010-05-11 21:57 [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops Kevin Hilman
@ 2010-05-13 18:48 ` Matt Fleming
  2010-05-14 16:51   ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Fleming @ 2010-05-13 18:48 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-omap, Madhusudhan Chikkature, Adrian Hunter, Andrew Morton,
	Tony Lindgren, Denis Karpov, linux-kernel, linux-mmc

On Tue, 11 May 2010 14:57:16 -0700, Kevin Hilman <khilman@deeprootsystems.com> wrote:
> 
> Note that dev_pm_ops version of the suspend hook no longer takes a
> 'state' argument.  However, the MMC core function mmc_suspend_host()
> still takes a 'state' argument, but it is unused, so a dummy
> state variable was created to pass to the MMC core.

Hmm.. instead of passing this dummy state argument why don't we just
remove the argument from mmc_suspend_host()? Like you said, it's unused,
so I don't see a reason to keep it around?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops
  2010-05-13 18:48 ` Matt Fleming
@ 2010-05-14 16:51   ` Kevin Hilman
  2010-05-14 22:57     ` Matt Fleming
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2010-05-14 16:51 UTC (permalink / raw)
  To: Matt Fleming
  Cc: linux-omap, Madhusudhan Chikkature, Adrian Hunter, Andrew Morton,
	Tony Lindgren, Denis Karpov, linux-kernel, linux-mmc

Matt Fleming <matt@console-pimps.org> writes:

> On Tue, 11 May 2010 14:57:16 -0700, Kevin Hilman <khilman@deeprootsystems.com> wrote:
>> 
>> Note that dev_pm_ops version of the suspend hook no longer takes a
>> 'state' argument.  However, the MMC core function mmc_suspend_host()
>> still takes a 'state' argument, but it is unused, so a dummy
>> state variable was created to pass to the MMC core.
>
> Hmm.. instead of passing this dummy state argument why don't we just
> remove the argument from mmc_suspend_host()? Like you said, it's unused,
> so I don't see a reason to keep it around?

I don't see a reason either, but it requires patching the MMC core as
well as all the users.  As I'm not an MMC core person, I thought this
best left to someone in that domain.

Fixing the core and callers could easily be done on top of this patch.

Kevin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops
  2010-05-14 16:51   ` Kevin Hilman
@ 2010-05-14 22:57     ` Matt Fleming
  2010-05-18 16:34       ` Kevin Hilman
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Fleming @ 2010-05-14 22:57 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-omap, Madhusudhan Chikkature, Adrian Hunter, Andrew Morton,
	Tony Lindgren, Denis Karpov, linux-kernel, linux-mmc

On Fri, May 14, 2010 at 09:51:21AM -0700, Kevin Hilman wrote:
> 
> I don't see a reason either, but it requires patching the MMC core as
> well as all the users.  As I'm not an MMC core person, I thought this
> best left to someone in that domain.
> 
> Fixing the core and callers could easily be done on top of this patch.

I've sent a patch that fixes up all the callers now and Andrew has taken
it into -mm.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops
  2010-05-14 22:57     ` Matt Fleming
@ 2010-05-18 16:34       ` Kevin Hilman
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Hilman @ 2010-05-18 16:34 UTC (permalink / raw)
  To: Matt Fleming
  Cc: linux-omap, Madhusudhan Chikkature, Adrian Hunter, Andrew Morton,
	Tony Lindgren, Denis Karpov, linux-kernel, linux-mmc

Matt Fleming <matt@console-pimps.org> writes:

> On Fri, May 14, 2010 at 09:51:21AM -0700, Kevin Hilman wrote:
>> 
>> I don't see a reason either, but it requires patching the MMC core as
>> well as all the users.  As I'm not an MMC core person, I thought this
>> best left to someone in that domain.
>> 
>> Fixing the core and callers could easily be done on top of this patch.
>
> I've sent a patch that fixes up all the callers now and Andrew has taken
> it into -mm.

Very nice,  Thanks.

Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-18 16:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-11 21:57 [PATCH] MMC: OMAP HS-MMC: convert to dev_pm_ops Kevin Hilman
2010-05-13 18:48 ` Matt Fleming
2010-05-14 16:51   ` Kevin Hilman
2010-05-14 22:57     ` Matt Fleming
2010-05-18 16:34       ` Kevin Hilman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.