From patchwork Fri Nov 4 10:43:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 80812 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1078884qge; Fri, 4 Nov 2016 03:42:33 -0700 (PDT) X-Received: by 10.98.192.21 with SMTP id x21mr25245777pff.94.1478256153089; Fri, 04 Nov 2016 03:42:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e80si15693126pfl.8.2016.11.04.03.42.32; Fri, 04 Nov 2016 03:42:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934308AbcKDKm1 (ORCPT + 27 others); Fri, 4 Nov 2016 06:42:27 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:54454 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934210AbcKDKmW (ORCPT ); Fri, 4 Nov 2016 06:42:22 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id uA4AebT2028031; Fri, 4 Nov 2016 19:40:52 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com uA4AebT2028031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1478256052; bh=kReEObiB64PxUR3XfeAO/uwoCcwxMTZdxyLzq4mQI80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kcI/pXoUQp/2UHI0RkJQbtOE4E/6JI9DErotQPaR4DJtbDE4+L+rCyheBhcpVtDUb ZzWig/rHsbUAYVfU2RwosZHXKbQ5q0MYsDX1b3ts2J6w3eqSs1+vrCfOy4qopdHFQG SzRyn4STIicPllNCsWXq2+XgZB97X3+e+mNt6HlK4LwKl2JrHSGReMn9i1G1Tky6UQ IZ1ak2H/d+nTH+FVICta0k+uECa0qaQG2151mPF+Sbo7mJXyf8R3I9eo951nHYwhDt oYUwGkMsL2hRFfQ9lb0R9gSQjXI/evOXoi0jd85j2U/E30S9Ic4nKj3ltK8MERiI9B fNzHSnmnnTtaA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Masahiro Yamada , Brian Norris , linux-kernel@vger.kernel.org, Boris Brezillon , Stefan Agner , Richard Weinberger , David Woodhouse Subject: [PATCH 17/22] mtd: nand: vf610: return error code of nand_scan_ident/tail() on error Date: Fri, 4 Nov 2016 19:43:05 +0900 Message-Id: <1478256190-7452-18-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The nand_scan_ident/tail() returns an appropriate error value when it fails. Use it instead of the fixed error code -ENXIO. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/vf610_nfc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index 3ad514c..3ea4bb1 100644 --- a/drivers/mtd/nand/vf610_nfc.c +++ b/drivers/mtd/nand/vf610_nfc.c @@ -717,10 +717,9 @@ static int vf610_nfc_probe(struct platform_device *pdev) vf610_nfc_preinit_controller(nfc); /* first scan to find the device and get the page size */ - if (nand_scan_ident(mtd, 1, NULL)) { - err = -ENXIO; + err = nand_scan_ident(mtd, 1, NULL); + if (err) goto error; - } vf610_nfc_init_controller(nfc); @@ -775,10 +774,9 @@ static int vf610_nfc_probe(struct platform_device *pdev) } /* second phase scan */ - if (nand_scan_tail(mtd)) { - err = -ENXIO; + err = nand_scan_tail(mtd); + if (err) goto error; - } platform_set_drvdata(pdev, mtd);