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: 691228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t9JlM2t4kz9t2g for ; Fri, 4 Nov 2016 22:00:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="uDPTSYgl"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2cCm-0004xP-Id; Fri, 04 Nov 2016 10:58:40 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2cCK-0003xm-9t for linux-mtd@bombadil.infradead.org; Fri, 04 Nov 2016 10:58:12 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by casper.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2bwQ-000634-Cg for linux-mtd@lists.infradead.org; Fri, 04 Nov 2016 10:41:48 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161104_104147_208253_04EAA360 X-CRM114-Status: GOOD ( 12.39 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.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(-) 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;