linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND v3 2/2] media: camif-core: Add check for clk_enable()
@ 2024-11-25 19:18 Jiasheng Jiang
  2024-11-25 19:18 ` [PATCH RESEND v3 1/2] media: mipi-csis: " Jiasheng Jiang
  2024-11-29 11:29 ` [PATCH RESEND v3 2/2] media: camif-core: " Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Jiasheng Jiang @ 2024-11-25 19:18 UTC (permalink / raw)
  To: krzk
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Jiasheng Jiang

Add check for the return value of clk_enable() to gurantee the success.

Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
Changelog:

v2 -> v3:

1. No change

v1 -> v2:

1. No change
---
 .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
index de6e8f151849..221e3c447f36 100644
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
 static int s3c_camif_runtime_resume(struct device *dev)
 {
 	struct camif_dev *camif = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_enable(camif->clock[CLK_GATE]);
+	if (ret)
+		return ret;
 
-	clk_enable(camif->clock[CLK_GATE]);
 	/* null op on s3c244x */
-	clk_enable(camif->clock[CLK_CAM]);
+	ret = clk_enable(camif->clock[CLK_CAM]);
+	if (ret) {
+		clk_disable(camif->clock[CLK_GATE]);
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
2.25.1



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

end of thread, other threads:[~2024-11-29 11:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 19:18 [PATCH RESEND v3 2/2] media: camif-core: Add check for clk_enable() Jiasheng Jiang
2024-11-25 19:18 ` [PATCH RESEND v3 1/2] media: mipi-csis: " Jiasheng Jiang
2024-11-29 11:29   ` Krzysztof Kozlowski
2024-11-29 11:29 ` [PATCH RESEND v3 2/2] media: camif-core: " Krzysztof Kozlowski

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