linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <paul@crapouillou.net>, <maarten.lankhorst@linux.intel.com>,
	<mripard@kernel.org>, <tzimmermann@suse.de>, <airlied@gmail.com>,
	<daniel@ffwll.ch>
Cc: alexandre.belloni@bootlin.com, bbrezillon@kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	sam@ravnborg.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 08/26] drm: atmel-hlcdc: Remove #ifdef guards for PM related functions
Date: Thu, 10 Nov 2022 15:28:35 +0000	[thread overview]
Message-ID: <6bb2ede2-f4ac-acef-d6ff-cb0d567a6d00@microchip.com> (raw)
In-Reply-To: <20221107175106.360578-9-paul@crapouillou.net>

On 07.11.2022 19:50, Paul Cercueil wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle
> the .suspend/.resume callbacks.
> 
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use #ifdef guards.
> 
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Boris Brezillon <bbrezillon@kernel.org>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
> Cc: linux-arm-kernel@lists.infradead.org

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index f7e7f4e919c7..05146936cc70 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -784,7 +784,6 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
>         return 0;
>  }
> 
> -#ifdef CONFIG_PM_SLEEP
>  static int atmel_hlcdc_dc_drm_suspend(struct device *dev)
>  {
>         struct drm_device *drm_dev = dev_get_drvdata(dev);
> @@ -815,10 +814,10 @@ static int atmel_hlcdc_dc_drm_resume(struct device *dev)
> 
>         return drm_atomic_helper_resume(drm_dev, dc->suspend.state);
>  }
> -#endif
> 
> -static SIMPLE_DEV_PM_OPS(atmel_hlcdc_dc_drm_pm_ops,
> -               atmel_hlcdc_dc_drm_suspend, atmel_hlcdc_dc_drm_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_hlcdc_dc_drm_pm_ops,
> +                               atmel_hlcdc_dc_drm_suspend,
> +                               atmel_hlcdc_dc_drm_resume);
> 
>  static const struct of_device_id atmel_hlcdc_dc_of_match[] = {
>         { .compatible = "atmel,hlcdc-display-controller" },
> @@ -830,7 +829,7 @@ static struct platform_driver atmel_hlcdc_dc_platform_driver = {
>         .remove = atmel_hlcdc_dc_drm_remove,
>         .driver = {
>                 .name   = "atmel-hlcdc-display-controller",
> -               .pm     = &atmel_hlcdc_dc_drm_pm_ops,
> +               .pm     = pm_sleep_ptr(&atmel_hlcdc_dc_drm_pm_ops),
>                 .of_match_table = atmel_hlcdc_dc_of_match,
>         },
>  };
> --
> 2.35.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-11-10 15:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221107175106.360578-1-paul@crapouillou.net>
2022-11-07 17:50 ` [PATCH 03/26] drm: imx: Use the dev_pm_ops provided by modeset helper Paul Cercueil
2022-11-07 17:50 ` [PATCH 04/26] drm: rockchip: " Paul Cercueil
2022-11-07 17:50 ` [PATCH 06/26] drm: sun4i: " Paul Cercueil
2022-11-14  0:34   ` Samuel Holland
2022-11-07 17:50 ` [PATCH 07/26] drm: msxfb: " Paul Cercueil
2022-11-07 17:50 ` [PATCH 08/26] drm: atmel-hlcdc: Remove #ifdef guards for PM related functions Paul Cercueil
2022-11-07 17:53   ` Sam Ravnborg
2022-11-10 15:28   ` Claudiu.Beznea [this message]
2022-11-07 17:50 ` [PATCH 09/26] drm: exynos: " Paul Cercueil
2022-11-21  4:25   ` Inki Dae
2022-11-07 17:50 ` [PATCH 10/26] drm: imx/dcss: " Paul Cercueil
2022-11-11 14:27   ` Laurentiu Palcu
     [not found] ` <20221107175256.360839-1-paul@crapouillou.net>
2022-11-07 17:52   ` [PATCH 14/26] drm: mediatek: " Paul Cercueil
2022-11-07 17:52   ` [PATCH 18/26] drm: rockchip: " Paul Cercueil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bb2ede2-f4ac-acef-d6ff-cb0d567a6d00@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=airlied@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=paul@crapouillou.net \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).