From patchwork Thu Aug 10 05:17:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9892759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6606F603B4 for ; Thu, 10 Aug 2017 05:18:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60F7328ABA for ; Thu, 10 Aug 2017 05:18:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55B0428AC1; Thu, 10 Aug 2017 05:18:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C52C328AC0 for ; Thu, 10 Aug 2017 05:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=nI/gH8Z67xNfa2bXJJpao2AAPb/HEVK7fcl6TLl1SGM=; b=otw qSH1mjdnHfN7bCCdPTAJKk4516FZZhIHpuTNoXhhaORdlSTId/Ud9YeAKfsHWN/WdntHNeLajxfnK 2PWptDfpfbnT1jxTzXhDzMxdycAAncdpMRpvjqoIyeGqAnJpWXtZOgGgz9YpF9+YbTDyg5ATF30Iw WKCbB7idHdo1WoFLLXTvbL1hUlhhdbaIaMW3Y+1QuEayOdJr8o7/46jYUZnkAfZrYOvY2E0aJgqWK cQJ7IUaxCAe2k8tR0RIUU8JvVLmE1GebtzUUvWzKR+RnjFuvCmu+Cyx7v5XonMP21Lts/IEI1NLi5 kfCzN+NNGEm8aeVUqb4Tn/YRIlQNJmA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dffrW-0007eb-G1; Thu, 10 Aug 2017 05:18:26 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dffrT-0007ch-F8; Thu, 10 Aug 2017 05:18:25 +0000 Received: by mail-pg0-x243.google.com with SMTP id 83so7615460pgb.4; Wed, 09 Aug 2017 22:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uGDeiLKMyPmZAMJO/boCF8vTbvRWXPJ76kxcW6Gra1M=; b=eHfMhvxlKx+WjYVB9BlB0wxStwvbndKeygoKcNTkyQEG6SYP0NJr/a0o24MnYfiv0g 8oWGz5EcTHQxx0lwLya3A+o5YTozDWJZqk4+Rj1wMI5BHVyEvfJn5i6/ONnYwsNlr6PO oF4tBGN9nVF5kXkspUPvKbv5zCUu856dbt5mOmsjfBZlvSnTMAdrvc4nuqHqJXHG3Lsq f6IesBjYPyAJunzNKQ1bFg5ml/CFx5l0sL01Oh3jSX6eVmMc66BzSxL3cH5D3g8ymDLX fIYZtTxIV+g4iRb8+dH0bFCHeBoiSVnaQaE1TZaCdYIecAAEfQ/1K09xEbSF2xtwN0xR iSDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uGDeiLKMyPmZAMJO/boCF8vTbvRWXPJ76kxcW6Gra1M=; b=NoqLKazOgW9u55L83vppDWRQhw0+0iLgcCKYNjy6G0FD/wUeSq3YdqiV0Sn7W0xW2R jxVXJb6Ctz8KP25JrlHniskKamY0QUOQKa03vC1S0BD17roTCDKPdKXwU/eTHpFmGWbo 17jmhrN1ML4RM89cCU5ok6lAHVaqhsvGPrLN1pzYXeHQ5VH4M8SLXINJRoMPzZ+cB/GS tCBkjx+peZNP+/iZOWa1gNhp+We+QgAz03EBmBx5xIYDUGkVPGIoXpJv3AWPmGjwOfaF hOtMfHtglI1ZtT0BwUT5SKb+qmD2jHE8fvdD8gzj+vf7QX5yF9Pw50UL9VB44ziqNszJ BEnw== X-Gm-Message-State: AHYfb5jgLA99pP9TE/Kfo4R02SLbLt6Q97Jem3SlnBeiel9qIQWt8WRl 4PDukqN1a78etg== X-Received: by 10.84.218.136 with SMTP id r8mr11606002pli.111.1502342282368; Wed, 09 Aug 2017 22:18:02 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id 188sm4820251pfe.171.2017.08.09.22.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Aug 2017 22:18:00 -0700 (PDT) From: Arvind Yadav To: matthias.bgg@gmail.com, iommu@lists.linux-foundation.org, joro@8bytes.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170809_221823_539013_FFEF075C X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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);