Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751463AbdHJFSE (ORCPT ); Thu, 10 Aug 2017 01:18:04 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35263 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbdHJFSC (ORCPT ); Thu, 10 Aug 2017 01:18:02 -0400 From: Arvind Yadav To: matthias.bgg@gmail.com, iommu@lists.linux-foundation.org, joro@8bytes.org Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] memory: mtk-smi: Handle return value of clk_prepare_enable Date: Thu, 10 Aug 2017 10:47:32 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 36 clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- changes in v2: Rebase patch[1]https://lkml.org/lkml/2017/8/3/968 and apply this change. Otherwise will merge conflict. drivers/memory/mtk-smi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 2b798bb..583fb8d 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -315,6 +315,7 @@ static int mtk_smi_common_probe(struct platform_device *pdev) struct mtk_smi *common; struct resource *res; enum mtk_smi_gen smi_gen; + int ret; if (!dev->pm_domain) return -EPROBE_DEFER; @@ -349,7 +350,9 @@ static int mtk_smi_common_probe(struct platform_device *pdev) if (IS_ERR(common->clk_async)) return PTR_ERR(common->clk_async); - clk_prepare_enable(common->clk_async); + ret = clk_prepare_enable(common->clk_async); + if (ret) + return ret; } pm_runtime_enable(dev); platform_set_drvdata(pdev, common); -- 1.9.1