diff mbox series

mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS()

Message ID 20210828085446.1878-1-caihuoqing@baidu.com
State New
Headers show
Series mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS() | expand

Commit Message

Cai,Huoqing Aug. 28, 2021, 8:54 a.m. UTC
Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
operators ".runtime_suspend/.runtime_resume", because the
SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
in to make code a little clearer, a little more concise.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/mmc/host/omap_hsmmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ulf Hansson Sept. 6, 2021, 4:35 p.m. UTC | #1
On Sat, 28 Aug 2021 at 10:55, Cai Huoqing <caihuoqing@baidu.com> wrote:
>

> Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose

> operators ".runtime_suspend/.runtime_resume", because the

> SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought

> in to make code a little clearer, a little more concise.


That makes sense to me.

>

> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>

> ---

>  drivers/mmc/host/omap_hsmmc.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

>

> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c

> index 2f8038d69f67..748303e14841 100644

> --- a/drivers/mmc/host/omap_hsmmc.c

> +++ b/drivers/mmc/host/omap_hsmmc.c

> @@ -2156,8 +2156,7 @@ static int omap_hsmmc_runtime_resume(struct device *dev)

>

>  static const struct dev_pm_ops omap_hsmmc_dev_pm_ops = {

>         SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume)

> -       .runtime_suspend = omap_hsmmc_runtime_suspend,

> -       .runtime_resume = omap_hsmmc_runtime_resume,

> +       SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL)

>  };


When building this driver with CONFIG_PM being unset, the compiler
will complain about unused functions. Please add "#ifdef CONFIG_PM"
around the implementation of omap_hsmmc_runtime_suspend|resume() to
address that.

>

>  static struct platform_driver omap_hsmmc_driver = {

> --

> 2.25.1

>


Kind regards
Uffe
diff mbox series

Patch

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 2f8038d69f67..748303e14841 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2156,8 +2156,7 @@  static int omap_hsmmc_runtime_resume(struct device *dev)
 
 static const struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume)
-	.runtime_suspend = omap_hsmmc_runtime_suspend,
-	.runtime_resume = omap_hsmmc_runtime_resume,
+	SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NULL)
 };
 
 static struct platform_driver omap_hsmmc_driver = {