Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932910AbcKLV4U (ORCPT ); Sat, 12 Nov 2016 16:56:20 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34456 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754381AbcKLV4R (ORCPT ); Sat, 12 Nov 2016 16:56:17 -0500 Subject: Re: [PATCH 09/11] mtd: nand: denali: return error code from nand_scan_ident/tail on error To: Masahiro Yamada , linux-mtd@lists.infradead.org References: <1478666130-13413-1-git-send-email-yamada.masahiro@socionext.com> <1478666130-13413-10-git-send-email-yamada.masahiro@socionext.com> Cc: Alan Cox , David Woodhouse , Jason Roberts , Chuanxiao Dong , Dinh Nguyen , linux-kernel@vger.kernel.org, Boris Brezillon , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen From: Marek Vasut Message-ID: <2c28311c-bef0-a3f4-7b65-51bf122f5911@gmail.com> Date: Sat, 12 Nov 2016 22:40:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478666130-13413-10-git-send-email-yamada.masahiro@socionext.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1405 Lines: 49 On 11/09/2016 05:35 AM, Masahiro Yamada wrote: > The nand_scan_ident/tail() returns an appropriate error value when > it fails. Use it instead of the fixed -ENXIO. > > Signed-off-by: Masahiro Yamada Reviewed-by: Marek Vasut > --- > > drivers/mtd/nand/denali.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c > index f188a48..d482d8d 100644 > --- a/drivers/mtd/nand/denali.c > +++ b/drivers/mtd/nand/denali.c > @@ -1474,10 +1474,9 @@ int denali_init(struct denali_nand_info *denali) > * this is the first stage in a two step process to register > * with the nand subsystem > */ > - if (nand_scan_ident(mtd, denali->max_banks, NULL)) { > - ret = -ENXIO; > + ret = nand_scan_ident(mtd, denali->max_banks, NULL); > + if (ret) > goto failed_req_irq; > - } > > /* allocate the right size buffer now */ > devm_kfree(denali->dev, denali->buf.buf); > @@ -1580,10 +1579,9 @@ int denali_init(struct denali_nand_info *denali) > denali->nand.ecc.write_oob = denali_write_oob; > denali->nand.erase = denali_erase; > > - if (nand_scan_tail(mtd)) { > - ret = -ENXIO; > + ret = nand_scan_tail(mtd); > + if (ret) > goto failed_req_irq; > - } > > ret = mtd_device_register(mtd, NULL, 0); > if (ret) { > -- Best regards, Marek Vasut