diff mbox series

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

Message ID 20210912212935.11965-1-kilobyte@angband.pl (mailing list archive)
State New
Headers show
Series drm/rockchip: fix a -Werror fail on !CONFIG_PM_SLEEP | expand

Commit Message

Adam Borowski Sept. 12, 2021, 9:29 p.m. UTC
Signed-off-by: Adam Borowski <kilobyte@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(+)

Comments

Nicolas Frattaroli Sept. 12, 2021, 10:05 p.m. UTC | #1
Hi Adam,

On Sonntag, 12. September 2021 23:29:35 CEST Adam Borowski wrote:
> Signed-off-by: Adam Borowski <kilobyte@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
diff mbox series

Patch

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