From patchwork Tue Mar 8 07:55:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiasheng Jiang X-Patchwork-Id: 549559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0215AC433F5 for ; Tue, 8 Mar 2022 08:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344746AbiCHID3 (ORCPT ); Tue, 8 Mar 2022 03:03:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344744AbiCHID2 (ORCPT ); Tue, 8 Mar 2022 03:03:28 -0500 X-Greylist: delayed 397 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 08 Mar 2022 00:02:32 PST Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 464F313D10 for ; Tue, 8 Mar 2022 00:02:31 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-01 (Coremail) with SMTP id qwCowAAXH_v8Cydi1kunAg--.11175S2; Tue, 08 Mar 2022 15:55:41 +0800 (CST) From: Jiasheng Jiang To: m.szyprowski@samsung.com, andrzej.hajda@intel.com, mchehab@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] media: s5p-mfc: Handle error for clk_enable Date: Tue, 8 Mar 2022 15:55:38 +0800 Message-Id: <20220308075538.1117983-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: qwCowAAXH_v8Cydi1kunAg--.11175S2 X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fou0/ Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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]);