Commit d1355290 authored by Fabio Estevam's avatar Fabio Estevam Committed by Ulf Hansson

mmc: mxs-mmc: Simplify PM hooks

By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent cc87a358
...@@ -702,7 +702,7 @@ static int mxs_mmc_remove(struct platform_device *pdev) ...@@ -702,7 +702,7 @@ static int mxs_mmc_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int mxs_mmc_suspend(struct device *dev) static int mxs_mmc_suspend(struct device *dev)
{ {
struct mmc_host *mmc = dev_get_drvdata(dev); struct mmc_host *mmc = dev_get_drvdata(dev);
...@@ -722,22 +722,17 @@ static int mxs_mmc_resume(struct device *dev) ...@@ -722,22 +722,17 @@ static int mxs_mmc_resume(struct device *dev)
clk_prepare_enable(ssp->clk); clk_prepare_enable(ssp->clk);
return 0; return 0;
} }
static const struct dev_pm_ops mxs_mmc_pm_ops = {
.suspend = mxs_mmc_suspend,
.resume = mxs_mmc_resume,
};
#endif #endif
static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume);
static struct platform_driver mxs_mmc_driver = { static struct platform_driver mxs_mmc_driver = {
.probe = mxs_mmc_probe, .probe = mxs_mmc_probe,
.remove = mxs_mmc_remove, .remove = mxs_mmc_remove,
.id_table = mxs_ssp_ids, .id_table = mxs_ssp_ids,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
#ifdef CONFIG_PM
.pm = &mxs_mmc_pm_ops, .pm = &mxs_mmc_pm_ops,
#endif
.of_match_table = mxs_mmc_dt_ids, .of_match_table = mxs_mmc_dt_ids,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment