Skip to contentSkip to conversation

media: exynos4-is: Fix PM disable depth imbalance in fimc_is_probe

PATCH In review Miaoqian Lin 3 participants 3 messages Mar 7, 2022

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

PATCH 1/1 media: exynos4-is: Fix PM disable depth imbalance in fimc_is_probe

If probe fails then we need to call pm_runtime_disable() to balance out the previous pm_runtime_enable() call.

Fixes 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")
---
 drivers/media/platform/exynos4-is/fimc-is.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/exynos4-is/fimc-is.c +3 -1
index e55e411038f4..81b290dace3a 100644
@@ -830,7 +830,7 @@ static int fimc_is_probe(struct platform_device *pdev)
 
 	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0)
-		goto err_irq;
+		goto err_pm_disable;
 
 	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
 
@@ -864,6 +864,8 @@ static int fimc_is_probe(struct platform_device *pdev)
 	pm_runtime_put_noidle(dev);
 	if (!pm_runtime_enabled(dev))
 		fimc_is_runtime_suspend(dev);
+err_pm_disable:
+	pm_runtime_disable(dev);
 err_irq:
 	free_irq(is->irq, is);
 err_clk:
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Miaoqian Lin

If probe fails then we need to call pm_runtime_disable() to balance out the previous pm_runtime_enable() call.

Fixes 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")
---
 drivers/media/platform/exynos4-is/fimc-is.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Miaoqian Lin
Quoted 17 lines

-----Original Message-----
From: Miaoqian Lin [mailto:[email protected]]
Sent: Monday, March 7, 2022 1:22 PM
To: Sylwester Nawrocki <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Krzysztof Kozlowski <[email protected]>; Alim Akhtar <[email protected]>; Kyungmin Park <[email protected]>; Younghwan Joo <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]; linux- [email protected]
Cc: [email protected]
Subject: [PATCH] media: exynos4-is: Fix PM disable depth imbalance in fimc_is_probe

Quoted 6 lines

If probe fails then we need to call pm_runtime_disable() to balance out the previous pm_runtime_enable() call.

Fixes 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")

---

Thanks for fixing this

Quoted 28 lines

drivers/media/platform/exynos4-is/fimc-is.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/exynos4-is/fimc-is.c +3 -1
index e55e411038f4..81b290dace3a 100644
@@ -830,7 +830,7 @@ static int fimc_is_probe(struct platform_device *pdev)
 
 	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0)
-		goto err_irq;
+		goto err_pm_disable;
 
 	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
 
@@ -864,6 +864,8 @@ static int fimc_is_probe(struct platform_device *pdev)
 	pm_runtime_put_noidle(dev);
 	if (!pm_runtime_enabled(dev))
 		fimc_is_runtime_suspend(dev);
+err_pm_disable:
+	pm_runtime_disable(dev);

err_irq:

	free_irq(is->irq, is);

err_clk:
--
2.17.1