Skip to content

Commit

Permalink
mmc: OMAP HS-MMC: convert to dev_pm_ops
Browse files Browse the repository at this point in the history
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>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Matt Fleming <matt@console-pimps.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Kevin Hilman authored and Linus Torvalds committed May 27, 2010
1 parent b417577 commit a791daa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2267,10 +2267,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;
Expand Down Expand Up @@ -2316,9 +2318,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)
Expand Down Expand Up @@ -2369,13 +2372,17 @@ static int omap_hsmmc_resume(struct platform_device *pdev)
#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,
},
};

Expand Down

0 comments on commit a791daa

Please sign in to comment.