All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS()
@ 2021-08-28  8:54 Cai Huoqing
  2021-09-06 16:35 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-08-28  8:54 UTC (permalink / raw)
  To: ulf.hansson, dianders; +Cc: linux-mmc, linux-omap, Cai Huoqing

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(-)

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 = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS()
  2021-08-28  8:54 [PATCH] mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS() Cai Huoqing
@ 2021-09-06 16:35 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2021-09-06 16:35 UTC (permalink / raw)
  To: Cai Huoqing; +Cc: Doug Anderson, linux-mmc, linux-omap

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-06 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  8:54 [PATCH] mmc: omap_hsmmc: Make use of the helper macro SET_RUNTIME_PM_OPS() Cai Huoqing
2021-09-06 16:35 ` 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.