From patchwork Tue Aug 8 05:36:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9886581 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 37E3C60363 for ; Tue, 8 Aug 2017 05:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 292572846D for ; Tue, 8 Aug 2017 05:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BDF12879C; Tue, 8 Aug 2017 05:37:16 +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 97C0A2846D for ; Tue, 8 Aug 2017 05:37:15 +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:References: In-Reply-To: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:List-Owner; bh=lEg1EAEZ9MvzC9e57FEmqn6RPwxNrp9xNUDA5F8mwbM=; b=tG55zlE5B5vpIO7uin8lqWQ9wq DMLDopCHp9dX8vOhAhOvQB+XdHyqFweFjpCMRT6/TwgwwgZCDirfp8mjpqI5NQvLDcthdWjpQWh17 C0BRyOfWFxPaR2L4eQlAEu/NMbns/JOd35AKcMA/zPb89HpfPTkLYRu4BJ+v6EmGaKEorWpijYf6q r0GDr5tnv9Ex9E61f//318G8eJGUBY2r3bKwXWzkRa/2H3n1j3ZwMSq0uaGIGTOn+kw+oCDjv+b55 /JfaVkG6+OuKw7yH6vM0PFq1/7ATNQ44qZ6QAPuz8Pv59C40UkicBH7V4IT9Mp9/mVzM5/ycM7ldq yd7S2pHw==; 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 1dexCc-0001KD-5F; Tue, 08 Aug 2017 05:37:14 +0000 Received: from mail-vk0-x241.google.com ([2607:f8b0:400c:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dexCK-000152-0k; Tue, 08 Aug 2017 05:36:57 +0000 Received: by mail-vk0-x241.google.com with SMTP id g189so1293776vke.0; Mon, 07 Aug 2017 22:36:35 -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:in-reply-to:references; bh=xp7zOPu5oNSWFjzU8Z999494BnGtB5I/g5KhDEc5bxw=; b=jwZpFHkrV71qJ+CHOnysBH+SEYTKV/lYm7yFyVfWw85FkM/aMkkmKBj2+4491X8Ce/ +LKLoNIvZEykk0KgLy65saVFLK+R20xQY7NheHw6M+9BbRfa1xuxyyaIRh67imy0WoHI CwASKbuW09euRrOpN6nQYAAbvNCy1jQNwGkK0nSkbuXjb33XjSy4ZEcp2ePEA34b3Qsi qA7j4tqExSgGIopheO+iP4gmtvG9MHtmoby90qBkpjolPFGEXtybYkWUuxPmIecTPNZI 3hVdcJlYd9Tn4u5BIrkrVq9nMn6garQ9doPi4GSRaDJ6yXgZF6E529k6Mw7PNJEHinT8 ag3A== 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:in-reply-to :references; bh=xp7zOPu5oNSWFjzU8Z999494BnGtB5I/g5KhDEc5bxw=; b=FEtLAiIquRtBUTv6QtwB8cklr/2uIViVqo95bKKcFVXqoXwawJyQLEY/4h95oGvs2H XvJiwPsVA5mG5OK+WkoKx+/GPsXy8TE3pBNtVwgWl6tkBP48TywF5QrkOM3FKeoawTAC ORdIY6jyeMI3RkkBQg+wylCiXY0fPs0hpUmAHCYaruvD/aSgVbkpzGlDVO3npUZz9rQz 35gV28F2BTXBgVBhzsxPkLn9mkwi4FEe7Aa1lI5JnyCexrQCKLXNYak47rRc6mnTcZzV q2jTvpsAAzd3eMJtvQRAVXGIQojSuzR3vOtFLzN42rilVIjhEmOa6P7aBGLG9FK5djQg JWFQ== X-Gm-Message-State: AHYfb5hoJAb3mU+/eKuWhIazW3kDWuAm5HgF+zVbcWZD2jeB+eei2mWP /PzzL6eBTooOEksx X-Received: by 10.84.130.11 with SMTP id 11mr3355441plc.417.1502170594809; Mon, 07 Aug 2017 22:36:34 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id w23sm854553pfl.40.2017.08.07.22.36.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 22:36:33 -0700 (PDT) From: Arvind Yadav To: matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH] memory: mtk-smi: Handle return value of clk_prepare_enable Date: Tue, 8 Aug 2017 11:06:07 +0530 Message-Id: <2c1de1862ce9fdefe7653706915c146038b12c4c.1502167256.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <472bce58da459a7c64d0ad1cd39b74fa0fcf77f1.1502167256.git.arvind.yadav.cs@gmail.com> References: <472bce58da459a7c64d0ad1cd39b74fa0fcf77f1.1502167256.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170807_223656_177502_4024FEE1 X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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 MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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 Acked-by: Honghui Zhang --- 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 4afbc41..edf36f0 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -321,6 +321,7 @@ static int mtk_smi_common_probe(struct platform_device *pdev) struct resource *res; const struct of_device_id *of_id; enum mtk_smi_gen smi_gen; + int ret; if (!dev->pm_domain) return -EPROBE_DEFER; @@ -359,7 +360,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);