Skip to contentSkip to conversation

drm/exynos: fix building without CONFIG_PM_SLEEP

PATCH In review Arnd Bergmann 3 participants 6 messages Nov 17, 2015 – Jan 26, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: fix building without CONFIG_PM_SLEEP

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.

Fixes ("drm/exynos: add pm_runtime to Mixer")
drivers/gpu/drm/exynos/exynos_mixer.c +2 -4
index 7498c6e76a53..fcaf71df77c1 100644
@@ -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)
#1 lore raw

PATCH 1/1 drm/exynos: remove unused variables

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.

Fixes 186ba87a6e31 ("drm/exynos: add pm_runtime to DECON 5433")
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -2
index edfd6e390ef7..2ac1d4d14368 100644
@@ -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;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann

2015-11-18 0:08 GMT+09:00 Arnd Bergmann <[email protected]>:

Quoted 7 lines

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)

Quoted 6 lines

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

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?

Best regards,
Krzysztof

Quoted 37 lines
drivers/gpu/drm/exynos/exynos_mixer.c +2 -5
index 7498c6e76a53..fcaf71df77c1 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw

2016? 01? 26? 08:40? Krzysztof Kozlowski ?(?) ? ?:

Quoted 12 lines

2015-11-18 0:08 GMT+09:00 Arnd Bergmann <[email protected]>:

Quoted 11 lines

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.

Quoted 7 lines
Quoted 2 lines
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

Quoted 50 lines

Best regards,
Krzysztof

Quoted 34 lines
drivers/gpu/drm/exynos/exynos_mixer.c +2 -5
index 7498c6e76a53..fcaf71df77c1 100644
@@ -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)
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at 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 at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw
In reply to Arnd Bergmann

Hi Arnd,

Sorry for late.

2015년 11월 18일 00:08에 Arnd Bergmann 이(가) 쓴 글:

Quoted 19 lines

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.

Fixes ("drm/exynos: add pm_runtime to Mixer")
drivers/gpu/drm/exynos/exynos_mixer.c +0 -0
index 7498c6e76a53..fcaf71df77c1 100644

drivers/gpu/drm/exynos/exynos_mixer.c static int mixer_remove(struct platform_device *pdev) · line 1233

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_mixer.c +0 -1
@@ -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

Quoted 24 lines
drivers/gpu/drm/exynos/exynos_mixer.c +2 -3
-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)
#5 lore raw
Quoted 5 lines · On Tuesday 26 January 2016 15:21:41 Inki Dae wrote:
Quoted 1 line

-#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