Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbdFGHcq (ORCPT ); Wed, 7 Jun 2017 03:32:46 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:36156 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751003AbdFGHcp (ORCPT ); Wed, 7 Jun 2017 03:32:45 -0400 Date: Wed, 7 Jun 2017 09:32:33 +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, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: nand: orion: Handle return value of clk_prepare_enable Message-ID: <20170607093233.2f950148@bbrezillon> In-Reply-To: <8ff46d4fcedc129a76cef82f344ae182309e633d.1496314473.git.arvind.yadav.cs@gmail.com> References: <8ff46d4fcedc129a76cef82f344ae182309e633d.1496314473.git.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: 854 Lines: 34 On Thu, 1 Jun 2017 16:28:15 +0530 Arvind Yadav wrote: > clk_prepare_enable() can fail here and we must check its return value. > Applied. Thanks, Boris > Signed-off-by: Arvind Yadav > --- > drivers/mtd/nand/orion_nand.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c > index f8e463a..209170e 100644 > --- a/drivers/mtd/nand/orion_nand.c > +++ b/drivers/mtd/nand/orion_nand.c > @@ -166,7 +166,11 @@ static int __init orion_nand_probe(struct platform_device *pdev) > } > } > > - clk_prepare_enable(info->clk); > + ret = clk_prepare_enable(info->clk); > + if (ret) { > + dev_err(&pdev->dev, "failed to prepare clock!\n"); > + return ret; > + } > > ret = nand_scan(mtd, 1); > if (ret)