aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-11-17 21:43:39 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-26 08:31:02 -0500
commitd13552908b2f3bdf917d0f4a308f69608c92c7e7 (patch)
treef89063317561014856a90b59b330b2564c78e86e /drivers/mmc
parentcc87a358c5759b23866d656417db2d6d7e0a4657 (diff)
mmc: mxs-mmc: Simplify PM hooks
By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mxs-mmc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 339059a9a648..c049ac75a36a 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -702,7 +702,7 @@ static int mxs_mmc_remove(struct platform_device *pdev)
702 return 0; 702 return 0;
703} 703}
704 704
705#ifdef CONFIG_PM 705#ifdef CONFIG_PM_SLEEP
706static int mxs_mmc_suspend(struct device *dev) 706static int mxs_mmc_suspend(struct device *dev)
707{ 707{
708 struct mmc_host *mmc = dev_get_drvdata(dev); 708 struct mmc_host *mmc = dev_get_drvdata(dev);
@@ -722,22 +722,17 @@ static int mxs_mmc_resume(struct device *dev)
722 clk_prepare_enable(ssp->clk); 722 clk_prepare_enable(ssp->clk);
723 return 0; 723 return 0;
724} 724}
725
726static const struct dev_pm_ops mxs_mmc_pm_ops = {
727 .suspend = mxs_mmc_suspend,
728 .resume = mxs_mmc_resume,
729};
730#endif 725#endif
731 726
727static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume);
728
732static struct platform_driver mxs_mmc_driver = { 729static struct platform_driver mxs_mmc_driver = {
733 .probe = mxs_mmc_probe, 730 .probe = mxs_mmc_probe,
734 .remove = mxs_mmc_remove, 731 .remove = mxs_mmc_remove,
735 .id_table = mxs_ssp_ids, 732 .id_table = mxs_ssp_ids,
736 .driver = { 733 .driver = {
737 .name = DRIVER_NAME, 734 .name = DRIVER_NAME,
738#ifdef CONFIG_PM
739 .pm = &mxs_mmc_pm_ops, 735 .pm = &mxs_mmc_pm_ops,
740#endif
741 .of_match_table = mxs_mmc_dt_ids, 736 .of_match_table = mxs_mmc_dt_ids,
742 }, 737 },
743}; 738};