aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-10-23 08:57:50 -0400
committerChris Ball <chris@printf.net>2014-02-13 22:58:01 -0500
commitc8964481d0273ef77a37ed2c627482fde3a1222c (patch)
treec9b234165107f4f2302e353ef5750b0d152b3577 /drivers/mmc/host
parent4e262d7f6fd43d798175cf26223c5bd3ebfd7b13 (diff)
mmc: tmio_mmc: Convert from legacy to modern PM ops
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/tmio_mmc.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 1900abb04236..cfad844730d8 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -23,38 +23,37 @@
23 23
24#include "tmio_mmc.h" 24#include "tmio_mmc.h"
25 25
26#ifdef CONFIG_PM 26#ifdef CONFIG_PM_SLEEP
27static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) 27static int tmio_mmc_suspend(struct device *dev)
28{ 28{
29 const struct mfd_cell *cell = mfd_get_cell(dev); 29 struct platform_device *pdev = to_platform_device(dev);
30 const struct mfd_cell *cell = mfd_get_cell(pdev);
30 int ret; 31 int ret;
31 32
32 ret = tmio_mmc_host_suspend(&dev->dev); 33 ret = tmio_mmc_host_suspend(dev);
33 34
34 /* Tell MFD core it can disable us now.*/ 35 /* Tell MFD core it can disable us now.*/
35 if (!ret && cell->disable) 36 if (!ret && cell->disable)
36 cell->disable(dev); 37 cell->disable(pdev);
37 38
38 return ret; 39 return ret;
39} 40}
40 41
41static int tmio_mmc_resume(struct platform_device *dev) 42static int tmio_mmc_resume(struct device *dev)
42{ 43{
43 const struct mfd_cell *cell = mfd_get_cell(dev); 44 struct platform_device *pdev = to_platform_device(dev);
45 const struct mfd_cell *cell = mfd_get_cell(pdev);
44 int ret = 0; 46 int ret = 0;
45 47
46 /* Tell the MFD core we are ready to be enabled */ 48 /* Tell the MFD core we are ready to be enabled */
47 if (cell->resume) 49 if (cell->resume)
48 ret = cell->resume(dev); 50 ret = cell->resume(pdev);
49 51
50 if (!ret) 52 if (!ret)
51 ret = tmio_mmc_host_resume(&dev->dev); 53 ret = tmio_mmc_host_resume(dev);
52 54
53 return ret; 55 return ret;
54} 56}
55#else
56#define tmio_mmc_suspend NULL
57#define tmio_mmc_resume NULL
58#endif 57#endif
59 58
60static int tmio_mmc_probe(struct platform_device *pdev) 59static int tmio_mmc_probe(struct platform_device *pdev)
@@ -134,15 +133,18 @@ static int tmio_mmc_remove(struct platform_device *pdev)
134 133
135/* ------------------- device registration ----------------------- */ 134/* ------------------- device registration ----------------------- */
136 135
136static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
137 SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
138};
139
137static struct platform_driver tmio_mmc_driver = { 140static struct platform_driver tmio_mmc_driver = {
138 .driver = { 141 .driver = {
139 .name = "tmio-mmc", 142 .name = "tmio-mmc",
140 .owner = THIS_MODULE, 143 .owner = THIS_MODULE,
144 .pm = &tmio_mmc_dev_pm_ops,
141 }, 145 },
142 .probe = tmio_mmc_probe, 146 .probe = tmio_mmc_probe,
143 .remove = tmio_mmc_remove, 147 .remove = tmio_mmc_remove,
144 .suspend = tmio_mmc_suspend,
145 .resume = tmio_mmc_resume,
146}; 148};
147 149
148module_platform_driver(tmio_mmc_driver); 150module_platform_driver(tmio_mmc_driver);