linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP
@ 2015-11-17 15:08 Arnd Bergmann
  2015-11-17 15:45 ` [PATCH] drm/exynos: remove unused variables Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-11-17 15:08 UTC (permalink / raw)
  To: Inki Dae
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel,
	linux-arm-kernel, linux-kernel, linux-samsung-soc

The runtime PM operations use the suspend/resume functions
even when CONFIG_PM_SLEEP is not set, but this now fails
for the exynos DRM driver:

exynos_mixer.c:1289:61: error: 'exynos_mixer_resume' undeclared here (not in a function)
  SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)

This removes the #ifdef and instead marks the functions as
__maybe_unused, which does the right thing in all cases and
also looks nicer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 	 ("drm/exynos: add pm_runtime to Mixer")

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 7498c6e76a53..fcaf71df77c1 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1230,8 +1230,7 @@ static int mixer_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int exynos_mixer_suspend(struct device *dev)
+static int __maybe_unused exynos_mixer_suspend(struct device *dev)
 {
 	struct mixer_context *ctx = dev_get_drvdata(dev);
 	struct mixer_resources *res = &ctx->mixer_res;
@@ -1247,7 +1246,7 @@ static int exynos_mixer_suspend(struct device *dev)
 	return 0;
 }
 
-static int exynos_mixer_resume(struct device *dev)
+static int __maybe_unused exynos_mixer_resume(struct device *dev)
 {
 	struct mixer_context *ctx = dev_get_drvdata(dev);
 	struct mixer_resources *res = &ctx->mixer_res;
@@ -1283,7 +1282,6 @@ static int exynos_mixer_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops exynos_mixer_pm_ops = {
 	SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)


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

* [PATCH] drm/exynos: remove unused variables
  2015-11-17 15:08 [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Arnd Bergmann
@ 2015-11-17 15:45 ` Arnd Bergmann
  2016-01-25 23:40 ` [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Krzysztof Kozlowski
  2016-01-26  6:21 ` Inki Dae
  2 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-11-17 15:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Inki Dae, linux-samsung-soc, Joonyoung Shim, Seung-Woo Kim,
	linux-kernel, dri-devel, Kyungmin Park

After a recent change, two variables were left unused:

exynos/exynos5433_drm_decon.c: In function 'decon_enable':
exynos/exynos5433_drm_decon.c:381:6: warning: unused variable 'i' [-Wunused-variable]
exynos/exynos5433_drm_decon.c:380:6: warning: unused variable 'ret' [-Wunused-variable]

This removes them too.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 186ba87a6e31 ("drm/exynos: add pm_runtime to DECON 5433")

diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index edfd6e390ef7..2ac1d4d14368 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -377,8 +377,6 @@ static void decon_swreset(struct decon_context *ctx)
 static void decon_enable(struct exynos_drm_crtc *crtc)
 {
 	struct decon_context *ctx = crtc->ctx;
-	int ret;
-	int i;
 
 	if (!test_and_clear_bit(BIT_SUSPENDED, &ctx->flags))
 		return;


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

* Re: [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP
  2015-11-17 15:08 [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Arnd Bergmann
  2015-11-17 15:45 ` [PATCH] drm/exynos: remove unused variables Arnd Bergmann
@ 2016-01-25 23:40 ` Krzysztof Kozlowski
  2016-01-26  4:55   ` Inki Dae
  2016-01-26  6:21 ` Inki Dae
  2 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2016-01-25 23:40 UTC (permalink / raw)
  To: Arnd Bergmann, Inki Dae
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel,
	linux-arm-kernel, linux-kernel, linux-samsung-soc

2015-11-18 0:08 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> The runtime PM operations use the suspend/resume functions
> even when CONFIG_PM_SLEEP is not set, but this now fails
> for the exynos DRM driver:
>
> exynos_mixer.c:1289:61: error: 'exynos_mixer_resume' undeclared here (not in a function)
>   SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)
>
> This removes the #ifdef and instead marks the functions as
> __maybe_unused, which does the right thing in all cases and
> also looks nicer.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes:   ("drm/exynos: add pm_runtime to Mixer")

Dear Inki,

Ping? On 4.5-rc1 this is still broken. Can you apply this for fixes
for current rc-cycle?

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof


>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 7498c6e76a53..fcaf71df77c1 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1230,8 +1230,7 @@ static int mixer_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int exynos_mixer_suspend(struct device *dev)
> +static int __maybe_unused exynos_mixer_suspend(struct device *dev)
>  {
>         struct mixer_context *ctx = dev_get_drvdata(dev);
>         struct mixer_resources *res = &ctx->mixer_res;
> @@ -1247,7 +1246,7 @@ static int exynos_mixer_suspend(struct device *dev)
>         return 0;
>  }
>
> -static int exynos_mixer_resume(struct device *dev)
> +static int __maybe_unused exynos_mixer_resume(struct device *dev)
>  {
>         struct mixer_context *ctx = dev_get_drvdata(dev);
>         struct mixer_resources *res = &ctx->mixer_res;
> @@ -1283,7 +1282,6 @@ static int exynos_mixer_resume(struct device *dev)
>
>         return 0;
>  }
> -#endif
>
>  static const struct dev_pm_ops exynos_mixer_pm_ops = {
>         SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP
  2016-01-25 23:40 ` [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Krzysztof Kozlowski
@ 2016-01-26  4:55   ` Inki Dae
  0 siblings, 0 replies; 6+ messages in thread
From: Inki Dae @ 2016-01-26  4:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Arnd Bergmann
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel,
	linux-arm-kernel, linux-kernel, linux-samsung-soc



2016년 01월 26일 08:40에 Krzysztof Kozlowski 이(가) 쓴 글:
> 2015-11-18 0:08 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>> The runtime PM operations use the suspend/resume functions
>> even when CONFIG_PM_SLEEP is not set, but this now fails
>> for the exynos DRM driver:
>>
>> exynos_mixer.c:1289:61: error: 'exynos_mixer_resume' undeclared here (not in a function)
>>   SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)
>>
>> This removes the #ifdef and instead marks the functions as
>> __maybe_unused, which does the right thing in all cases and
>> also looks nicer.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes:   ("drm/exynos: add pm_runtime to Mixer")
> 
> Dear Inki,
> 
> Ping? On 4.5-rc1 this is still broken. Can you apply this for fixes
> for current rc-cycle?

Got it.

Thanks,
Inki Dae

> 
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> Best regards,
> Krzysztof
> 
> 
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index 7498c6e76a53..fcaf71df77c1 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>> @@ -1230,8 +1230,7 @@ static int mixer_remove(struct platform_device *pdev)
>>         return 0;
>>  }
>>
>> -#ifdef CONFIG_PM_SLEEP
>> -static int exynos_mixer_suspend(struct device *dev)
>> +static int __maybe_unused exynos_mixer_suspend(struct device *dev)
>>  {
>>         struct mixer_context *ctx = dev_get_drvdata(dev);
>>         struct mixer_resources *res = &ctx->mixer_res;
>> @@ -1247,7 +1246,7 @@ static int exynos_mixer_suspend(struct device *dev)
>>         return 0;
>>  }
>>
>> -static int exynos_mixer_resume(struct device *dev)
>> +static int __maybe_unused exynos_mixer_resume(struct device *dev)
>>  {
>>         struct mixer_context *ctx = dev_get_drvdata(dev);
>>         struct mixer_resources *res = &ctx->mixer_res;
>> @@ -1283,7 +1282,6 @@ static int exynos_mixer_resume(struct device *dev)
>>
>>         return 0;
>>  }
>> -#endif
>>
>>  static const struct dev_pm_ops exynos_mixer_pm_ops = {
>>         SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

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

* Re: [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP
  2015-11-17 15:08 [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Arnd Bergmann
  2015-11-17 15:45 ` [PATCH] drm/exynos: remove unused variables Arnd Bergmann
  2016-01-25 23:40 ` [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Krzysztof Kozlowski
@ 2016-01-26  6:21 ` Inki Dae
  2016-01-26 12:56   ` Arnd Bergmann
  2 siblings, 1 reply; 6+ messages in thread
From: Inki Dae @ 2016-01-26  6:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel,
	linux-arm-kernel, linux-kernel, linux-samsung-soc

Hi Arnd,

Sorry for late.

2015년 11월 18일 00:08에 Arnd Bergmann 이(가) 쓴 글:
> The runtime PM operations use the suspend/resume functions
> even when CONFIG_PM_SLEEP is not set, but this now fails
> for the exynos DRM driver:
> 
> exynos_mixer.c:1289:61: error: 'exynos_mixer_resume' undeclared here (not in a function)
>   SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)
> 
> This removes the #ifdef and instead marks the functions as
> __maybe_unused, which does the right thing in all cases and
> also looks nicer.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 	 ("drm/exynos: add pm_runtime to Mixer")
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 7498c6e76a53..fcaf71df77c1 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1230,8 +1230,7 @@ static int mixer_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP

How about just changing it to CONFIG_PM for consistency of other kms drivers?
Actually, I had modified it to PM since original auther, Gustavo Padovan, posted runtime pm support.
However, it seems missing this one.

Thanks,
Inki Dae

> -static int exynos_mixer_suspend(struct device *dev)
> +static int __maybe_unused exynos_mixer_suspend(struct device *dev)
>  {
>  	struct mixer_context *ctx = dev_get_drvdata(dev);
>  	struct mixer_resources *res = &ctx->mixer_res;
> @@ -1247,7 +1246,7 @@ static int exynos_mixer_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int exynos_mixer_resume(struct device *dev)
> +static int __maybe_unused exynos_mixer_resume(struct device *dev)
>  {
>  	struct mixer_context *ctx = dev_get_drvdata(dev);
>  	struct mixer_resources *res = &ctx->mixer_res;
> @@ -1283,7 +1282,6 @@ static int exynos_mixer_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
>  
>  static const struct dev_pm_ops exynos_mixer_pm_ops = {
>  	SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL)
> 
> 

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

* Re: [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP
  2016-01-26  6:21 ` Inki Dae
@ 2016-01-26 12:56   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-01-26 12:56 UTC (permalink / raw)
  To: Inki Dae
  Cc: Joonyoung Shim, Seung-Woo Kim, Kyungmin Park, dri-devel,
	linux-arm-kernel, linux-kernel, linux-samsung-soc

On Tuesday 26 January 2016 15:21:41 Inki Dae wrote:
> > -#ifdef CONFIG_PM_SLEEP
> 
> How about just changing it to CONFIG_PM for consistency of other kms drivers?
> Actually, I had modified it to PM since original auther, Gustavo Padovan, posted runtime pm support.
> However, it seems missing this one.

Everybody gets the #ifdef's wrong, so the __maybe_unused approach is
being used increasingly all over the kernel.

	Arnd

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

end of thread, other threads:[~2016-01-26 12:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17 15:08 [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Arnd Bergmann
2015-11-17 15:45 ` [PATCH] drm/exynos: remove unused variables Arnd Bergmann
2016-01-25 23:40 ` [PATCH] drm/exynos: fix building without CONFIG_PM_SLEEP Krzysztof Kozlowski
2016-01-26  4:55   ` Inki Dae
2016-01-26  6:21 ` Inki Dae
2016-01-26 12:56   ` Arnd Bergmann

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