From patchwork Fri Nov 4 10:42:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 80807 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1078729qge; Fri, 4 Nov 2016 03:42:08 -0700 (PDT) X-Received: by 10.99.136.194 with SMTP id l185mr21185284pgd.106.1478256128155; Fri, 04 Nov 2016 03:42:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p26si3919117pfk.183.2016.11.04.03.42.07; Fri, 04 Nov 2016 03:42:08 -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 S1761274AbcKDKmC (ORCPT + 27 others); Fri, 4 Nov 2016 06:42:02 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:53709 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758076AbcKDKmB (ORCPT ); Fri, 4 Nov 2016 06:42:01 -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 uA4AebSq028031; Fri, 4 Nov 2016 19:40:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com uA4AebSq028031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1478256044; bh=jV9nL17yZ8fABrGCc8B2DCvUhF22/9EVwn7MTFiwqLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yOacVRVAz0kjvF8kVftDTCXR5kMu0wK0i7S76v3ZqTIYgmoXClAWBH2SIfVirC8nZ WO111QaLdWwhyJk+KQwenNDkSKbgmmMLku/ibpsj+43oGzdFcsENL0+VuJgQ5dJSvO xHeNeTUCyyrHgi/7lo3F4hKsYnI39FOit97rRsx6B4NFiUGrOt7BOG8gZYz4RE44rD wP+rTzFZVA1gdNAVlDO0bYm1FEQfdi5DvLRvF8oOPCM6xwTEfPSBOO+t6U910HTa5A Iz0GH1FMoRY7CEOxnjf57nipxcbNo54Gox8wTl+fnI+NETgETOOvtcwResjRkvB/k7 0u/ciEJe96VoA== 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 07/22] mtd: nand: orion: return error code of nand_scan() on error Date: Fri, 4 Nov 2016 19:42:55 +0900 Message-Id: <1478256190-7452-8-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/orion_nand.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 40a7c4a..4a91c5d 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c @@ -155,10 +155,9 @@ static int __init orion_nand_probe(struct platform_device *pdev) clk_put(clk); } - if (nand_scan(mtd, 1)) { - ret = -ENXIO; + ret = nand_scan(mtd, 1); + if (ret) goto no_dev; - } mtd->name = "orion_nand"; ret = mtd_device_register(mtd, board->parts, board->nr_parts);