From patchwork Fri Nov 4 10:42:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 80824 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1079799qge; Fri, 4 Nov 2016 03:45:31 -0700 (PDT) X-Received: by 10.99.140.12 with SMTP id m12mr21276235pgd.45.1478256331119; Fri, 04 Nov 2016 03:45:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si15660934pgf.317.2016.11.04.03.45.30; Fri, 04 Nov 2016 03:45:31 -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 S933798AbcKDKmI (ORCPT + 27 others); Fri, 4 Nov 2016 06:42:08 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:53944 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933462AbcKDKmG (ORCPT ); Fri, 4 Nov 2016 06:42:06 -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 uA4AebSs028031; Fri, 4 Nov 2016 19:40:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com uA4AebSs028031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1478256045; bh=86jZ3DzfDtBLC2W4OCgq69fmUXuywwIkPPH5LauZSWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uDPTSYglLzkbl5Wvx3EcR80gqWE3f9U66FNHolbuDv/3aF6GJA8oaZuYC1vyKFMim wGgovK4bhPbQ7UQwdW2nsnmvGFoeJBWROXQB1WuYfTk0DXks7OGqc5Q/VcTjmNqdmQ JrLCNlFeHlA4mlTng+nXxwN/7aC1vSq+3uCvJeTmTKIDAeEBTqESO6EcBZ3FwraipT YsUT9TyRMNxv45b9OnLNOGmtHQFBhfoPXCjxO5FdHQ3EPC3jGnB0YeVjWpSUxAy/QO pXRXL0zfUlKidDeW64WsN0oSga8rfGrH5daxfUyioLvAdQRdMwP5LuCbDc/gcaDXcG 7FVN+rqeRtgIQ== 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 09/22] mtd: nand: plat_nand: return error code of nand_scan() on error Date: Fri, 4 Nov 2016 19:42:57 +0900 Message-Id: <1478256190-7452-10-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() 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/plat_nand.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 415a53a..791de3e 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -86,10 +86,9 @@ static int plat_nand_probe(struct platform_device *pdev) } /* Scan to find existence of the device */ - if (nand_scan(mtd, pdata->chip.nr_chips)) { - err = -ENXIO; + err = nand_scan(mtd, pdata->chip.nr_chips); + if (err) goto out; - } part_types = pdata->chip.part_probe_types;