From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
To: krzk@kernel.org
Cc: sylvester.nawrocki@gmail.com, mchehab@kernel.org,
dron0gus@gmail.com, tomasz.figa@gmail.com,
alim.akhtar@samsung.com, kyungmin.park@samsung.com,
laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiasheng Jiang <jiashengjiangcool@gmail.com>
Subject: [PATCH 2/2] media: camif-core: Add check for clk_enable()
Date: Sat, 23 Nov 2024 21:26:23 +0000 [thread overview]
Message-ID: <20241123212624.6237-1-jiashengjiangcool@gmail.com> (raw)
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>
---
.../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
next reply other threads:[~2024-11-23 21:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-23 21:26 Jiasheng Jiang [this message]
2024-11-23 21:26 ` [PATCH RESEND v3 1/2] media: mipi-csis: Add check for clk_enable() Jiasheng Jiang
2024-11-24 10:50 ` [PATCH 2/2] media: camif-core: " Krzysztof Kozlowski
2024-11-24 21:10 ` Jiasheng Jiang
2024-11-25 7:27 ` Krzysztof Kozlowski
2024-11-25 19:19 ` Jiasheng Jiang
-- strict thread matches above, loose matches on Subject: below --
2024-11-22 22:13 Jiasheng Jiang
2024-11-23 16:00 ` Krzysztof Kozlowski
2024-11-23 21:29 ` Jiasheng Jiang
2024-11-22 19:53 Jiasheng Jiang
2024-11-21 21:05 Jiasheng Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241123212624.6237-1-jiashengjiangcool@gmail.com \
--to=jiashengjiangcool@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=dron0gus@gmail.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sylvester.nawrocki@gmail.com \
--cc=tomasz.figa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox