Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751911AbdHCPU2 (ORCPT ); Thu, 3 Aug 2017 11:20:28 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:57602 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751773AbdHCPU1 (ORCPT ); Thu, 3 Aug 2017 11:20:27 -0400 Date: Thu, 3 Aug 2017 17:20:25 +0200 From: Boris Brezillon To: Arvind Yadav Cc: richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, cyrille.pitchen@wedev4u.fr, narmstrong@baylibre.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/6] mtd: nand: vf610_nfc: Handle return value of clk_prepare_enable. Message-ID: <20170803172025.1058d316@bbrezillon> In-Reply-To: <1501587558-21227-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1501587558-21227-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1110 Lines: 41 On Tue, 1 Aug 2017 17:09:18 +0530 Arvind Yadav wrote: > clk_prepare_enable() can fail here and we must check its return value. You're just a few days late, this one has already been proposed by Fabio [1] ;-). I'll queue other patches from this patchset. Thanks, Boris [1]https://patchwork.ozlabs.org/patch/789812/ > > Signed-off-by: Arvind Yadav > --- > drivers/mtd/nand/vf610_nfc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c > index 744ab10..db03d4f 100644 > --- a/drivers/mtd/nand/vf610_nfc.c > +++ b/drivers/mtd/nand/vf610_nfc.c > @@ -816,10 +816,13 @@ static int vf610_nfc_resume(struct device *dev) > { > struct mtd_info *mtd = dev_get_drvdata(dev); > struct vf610_nfc *nfc = mtd_to_nfc(mtd); > + int ret; > > pinctrl_pm_select_default_state(dev); > > - clk_prepare_enable(nfc->clk); > + ret = clk_prepare_enable(nfc->clk); > + if (ret) > + return ret; > > vf610_nfc_preinit_controller(nfc); > vf610_nfc_init_controller(nfc);