* [PATCH] mmc: mxs-mmc: Simplify PM hooks
@ 2014-11-18 2:43 Fabio Estevam
2014-11-19 11:00 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2014-11-18 2:43 UTC (permalink / raw)
To: ulf.hansson; +Cc: linux-mmc, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/mmc/host/mxs-mmc.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 339059a..c049ac7 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)
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: mxs-mmc: Simplify PM hooks
2014-11-18 2:43 [PATCH] mmc: mxs-mmc: Simplify PM hooks Fabio Estevam
@ 2014-11-19 11:00 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2014-11-19 11:00 UTC (permalink / raw)
To: Fabio Estevam; +Cc: linux-mmc, Fabio Estevam
On 18 November 2014 03:43, Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Thanks! Applied for next.
Kind regards
Uffe
> ---
> drivers/mmc/host/mxs-mmc.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 339059a..c049ac7 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)
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-19 11:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 2:43 [PATCH] mmc: mxs-mmc: Simplify PM hooks Fabio Estevam
2014-11-19 11:00 ` Ulf Hansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.