diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2010-05-26 17:42:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:40 -0400 |
commit | a791daa15305e7e549a418ef0ae6bc4b4580066e (patch) | |
tree | ba85b141bc4ca93cc151449964ce4f903b110c93 /drivers/mmc | |
parent | b417577d3b9bbb06a4ddc9aa955af9bd503f7242 (diff) |
mmc: OMAP HS-MMC: convert to dev_pm_ops
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | 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 c9401efd1137..d25b19b3ca29 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -2267,10 +2267,12 @@ static int omap_hsmmc_remove(struct platform_device *pdev) | |||
2267 | } | 2267 | } |
2268 | 2268 | ||
2269 | #ifdef CONFIG_PM | 2269 | #ifdef CONFIG_PM |
2270 | static int omap_hsmmc_suspend(struct platform_device *pdev, pm_message_t state) | 2270 | static int omap_hsmmc_suspend(struct device *dev) |
2271 | { | 2271 | { |
2272 | int ret = 0; | 2272 | int ret = 0; |
2273 | struct platform_device *pdev = to_platform_device(dev); | ||
2273 | struct omap_hsmmc_host *host = platform_get_drvdata(pdev); | 2274 | struct omap_hsmmc_host *host = platform_get_drvdata(pdev); |
2275 | pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */ | ||
2274 | 2276 | ||
2275 | if (host && host->suspended) | 2277 | if (host && host->suspended) |
2276 | return 0; | 2278 | return 0; |
@@ -2316,9 +2318,10 @@ static int omap_hsmmc_suspend(struct platform_device *pdev, pm_message_t state) | |||
2316 | } | 2318 | } |
2317 | 2319 | ||
2318 | /* Routine to resume the MMC device */ | 2320 | /* Routine to resume the MMC device */ |
2319 | static int omap_hsmmc_resume(struct platform_device *pdev) | 2321 | static int omap_hsmmc_resume(struct device *dev) |
2320 | { | 2322 | { |
2321 | int ret = 0; | 2323 | int ret = 0; |
2324 | struct platform_device *pdev = to_platform_device(dev); | ||
2322 | struct omap_hsmmc_host *host = platform_get_drvdata(pdev); | 2325 | struct omap_hsmmc_host *host = platform_get_drvdata(pdev); |
2323 | 2326 | ||
2324 | if (host && !host->suspended) | 2327 | if (host && !host->suspended) |
@@ -2369,13 +2372,17 @@ clk_en_err: | |||
2369 | #define omap_hsmmc_resume NULL | 2372 | #define omap_hsmmc_resume NULL |
2370 | #endif | 2373 | #endif |
2371 | 2374 | ||
2372 | static struct platform_driver omap_hsmmc_driver = { | 2375 | static struct dev_pm_ops omap_hsmmc_dev_pm_ops = { |
2373 | .remove = omap_hsmmc_remove, | ||
2374 | .suspend = omap_hsmmc_suspend, | 2376 | .suspend = omap_hsmmc_suspend, |
2375 | .resume = omap_hsmmc_resume, | 2377 | .resume = omap_hsmmc_resume, |
2378 | }; | ||
2379 | |||
2380 | static struct platform_driver omap_hsmmc_driver = { | ||
2381 | .remove = omap_hsmmc_remove, | ||
2376 | .driver = { | 2382 | .driver = { |
2377 | .name = DRIVER_NAME, | 2383 | .name = DRIVER_NAME, |
2378 | .owner = THIS_MODULE, | 2384 | .owner = THIS_MODULE, |
2385 | .pm = &omap_hsmmc_dev_pm_ops, | ||
2379 | }, | 2386 | }, |
2380 | }; | 2387 | }; |
2381 | 2388 | ||