mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: s5p-mfc: Handle error for clk_enable
@ 2022-03-08  7:55 Jiasheng Jiang
  2022-03-08 10:50 ` Andrzej Hajda
  0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2022-03-08  7:55 UTC (permalink / raw)
  To: m.szyprowski, andrzej.hajda, mchehab
  Cc: linux-arm-kernel, linux-media, linux-kernel, Jiasheng Jiang

As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: 1bce6fb3edf1 ("[media] s5p-mfc: Rework clock handling")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
index 88b7d33c9197..392e6fab0a75 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
@@ -106,10 +106,12 @@ int s5p_mfc_power_on(void)
 
 int s5p_mfc_power_off(void)
 {
-	int i;
+	int i, ret;
 
 	/* finish software clock gating */
-	clk_enable(pm->clock_gate);
+	ret = clk_enable(pm->clock_gate);
+	if (ret)
+		return ret;
 
 	for (i = 0; i < pm->num_clocks; i++)
 		clk_disable_unprepare(pm->clocks[i]);
-- 
2.25.1


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

end of thread, other threads:[~2022-03-08 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08  7:55 [PATCH] media: s5p-mfc: Handle error for clk_enable Jiasheng Jiang
2022-03-08 10:50 ` Andrzej Hajda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®