Skip to contentSkip to conversation

mmc: mxs-mmc: Simplify PM hooks

PATCH Applied Fabio Estevam 2 participants 2 messages Nov 18, 2014 – Nov 19, 2014

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 mmc: mxs-mmc: Simplify PM hooks

From: Fabio Estevam <[email protected]>

By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner.

---
 drivers/mmc/host/mxs-mmc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/mmc/host/mxs-mmc.c +3 -8
index 339059a..c049ac7 100644
@@ -702,7 +702,7 @@ static int mxs_mmc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int mxs_mmc_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
@@ -722,22 +722,17 @@ static int mxs_mmc_resume(struct device *dev)
 	clk_prepare_enable(ssp->clk);
 	return 0;
 }
-
-static const struct dev_pm_ops mxs_mmc_pm_ops = {
-	.suspend	= mxs_mmc_suspend,
-	.resume		= mxs_mmc_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume);
+
 static struct platform_driver mxs_mmc_driver = {
 	.probe		= mxs_mmc_probe,
 	.remove		= mxs_mmc_remove,
 	.id_table	= mxs_ssp_ids,
 	.driver		= {
 		.name	= DRIVER_NAME,
-#ifdef CONFIG_PM
 		.pm	= &mxs_mmc_pm_ops,
-#endif
 		.of_match_table = mxs_mmc_dt_ids,
 	},
 };
Signature · 1 line
1.9.1
Applied
#1 lore raw
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner.

Thanks! Applied for next.

Kind regards
Uffe

Quoted 45 lines
---
 drivers/mmc/host/mxs-mmc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/mmc/host/mxs-mmc.c +3 -9
index 339059a..c049ac7 100644
@@ -702,7 +702,7 @@ static int mxs_mmc_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int mxs_mmc_suspend(struct device *dev)
 {
        struct mmc_host *mmc = dev_get_drvdata(dev);
@@ -722,22 +722,17 @@ static int mxs_mmc_resume(struct device *dev)
        clk_prepare_enable(ssp->clk);
        return 0;
 }
-
-static const struct dev_pm_ops mxs_mmc_pm_ops = {
-       .suspend        = mxs_mmc_suspend,
-       .resume         = mxs_mmc_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume);
+
 static struct platform_driver mxs_mmc_driver = {
        .probe          = mxs_mmc_probe,
        .remove         = mxs_mmc_remove,
        .id_table       = mxs_ssp_ids,
        .driver         = {
                .name   = DRIVER_NAME,
-#ifdef CONFIG_PM
                .pm     = &mxs_mmc_pm_ops,
-#endif
                .of_match_table = mxs_mmc_dt_ids,
        },
 };
--

1.9.1