[PATCH] mmc:omap change driver to use dev_pm_ops infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change mmc_omap platform driver to register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@xxxxxxxxxxx>
---
 drivers/mmc/host/omap.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index b94f38e..3251df2 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1514,10 +1514,11 @@ static int mmc_omap_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int mmc_omap_suspend(struct platform_device *pdev, pm_message_t mesg)
+static int mmc_omap_suspend(struct device *dev)
 {
 	int i, ret = 0;
-	struct mmc_omap_host *host = platform_get_drvdata(pdev);
+	struct mmc_omap_host *host = platform_get_drvdata(to_platform_device(
+							  dev));
 
 	if (host == NULL || host->suspended)
 		return 0;
@@ -1539,10 +1540,11 @@ static int mmc_omap_suspend(struct platform_device *pdev, pm_message_t mesg)
 	return 0;
 }
 
-static int mmc_omap_resume(struct platform_device *pdev)
+static int mmc_omap_resume(struct device *dev)
 {
 	int i, ret = 0;
-	struct mmc_omap_host *host = platform_get_drvdata(pdev);
+	struct mmc_omap_host *host = platform_get_drvdata(to_platform_device(
+							  dev));
 
 	if (host == NULL || !host->suspended)
 		return 0;
@@ -1563,14 +1565,16 @@ static int mmc_omap_resume(struct platform_device *pdev)
 #define mmc_omap_resume		NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(mmc_omap_dev_pm_ops, mmc_omap_suspend,
+			 mmc_omap_resume);
+
 static struct platform_driver mmc_omap_driver = {
 	.probe		= mmc_omap_probe,
 	.remove		= mmc_omap_remove,
-	.suspend	= mmc_omap_suspend,
-	.resume		= mmc_omap_resume,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.pm	= &mmc_omap_dev_pm_ops,
 	},
 };
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux