Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934401AbcKDKmi (ORCPT ); Fri, 4 Nov 2016 06:42:38 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:54876 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934210AbcKDKmf (ORCPT ); Fri, 4 Nov 2016 06:42:35 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com uA4AebT4028031 X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Boris Brezillon , Brian Norris , Richard Weinberger , David Woodhouse Subject: [PATCH 19/22] mtd: nand: hisi504: return error code of nand_scan_ident() on error Date: Fri, 4 Nov 2016 19:43:07 +0900 Message-Id: <1478256190-7452-20-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478256190-7452-1-git-send-email-yamada.masahiro@socionext.com> References: <1478256190-7452-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 835 Lines: 28 The nand_scan_ident() returns an appropriate error value when it fails. Use it instead of the fixed error code -ENODEV. (This driver is already doing so for nand_scan_tail().) Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/hisi504_nand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/nand/hisi504_nand.c b/drivers/mtd/nand/hisi504_nand.c index 9432546..e40364e 100644 --- a/drivers/mtd/nand/hisi504_nand.c +++ b/drivers/mtd/nand/hisi504_nand.c @@ -774,10 +774,8 @@ static int hisi_nfc_probe(struct platform_device *pdev) } ret = nand_scan_ident(mtd, max_chips, NULL); - if (ret) { - ret = -ENODEV; + if (ret) goto err_res; - } host->buffer = dmam_alloc_coherent(dev, mtd->writesize + mtd->oobsize, &host->dma_buffer, GFP_KERNEL); -- 1.9.1