[PATCH] drm/rockchip: fix a -Werror fail on !CONFIG_PM_SLEEP

Nicolas Frattaroli frattaroli.nicolas at gmail.com
Sun Sep 12 22:05:29 UTC 2021


Hi Adam,

On Sonntag, 12. September 2021 23:29:35 CEST Adam Borowski wrote:
> Signed-off-by: Adam Borowski <kilobyte at angband.pl>
> ---
>  With Linus suddenly loving -Werror, let's get clean.
> 
>  drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 8ab3247dbc4a..bee0f2d2a9be
> 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -1123,6 +1123,7 @@ static int cdn_dp_suspend(struct device *dev)
>  	return ret;
>  }
> 
> +#ifdef CONFIG_PM_SLEEP

I think we prefer the function attribute __maybe_unused here, because it also 
makes sure to get rid of the warning for any functions it references.

>  static int cdn_dp_resume(struct device *dev)
>  {
>  	struct cdn_dp_device *dp = dev_get_drvdata(dev);
> @@ -1135,6 +1136,7 @@ static int cdn_dp_resume(struct device *dev)
> 
>  	return 0;
>  }
> +#endif
> 
>  static int cdn_dp_probe(struct platform_device *pdev)
>  {

Regards,
Nicolas Frattaroli




More information about the dri-devel mailing list