From patchwork Tue Jul 3 22:00:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10505459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 249E360225 for ; Tue, 3 Jul 2018 22:22:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1395226E39 for ; Tue, 3 Jul 2018 22:22:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0657C28A22; Tue, 3 Jul 2018 22:22:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 891AF26E39 for ; Tue, 3 Jul 2018 22:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=/gN1z4Vvr0keGiGdXDOdyL+iHO6YG+A44UarYcICxJk=; b=Aglli3/t/xATMO10C6mU9Fxx3r G2rwhK6Y8xX6ymobQyYZNrH6TDLL4FuA9gr/RWczHvHoWaJq4EkqBoa8U3ZuiQP3V3G2BZpiIoJXP toxVipgZPEKrdWy0eYojuaYiE8MoeJCeWBUmb2Wnjee8JrAwQzqjVLQL/hJPcGeNnBqp4xkyfHuic oGoBGMalD2vM5N2LbbTI84hNnYbxbpLrE27Eg7k9Gqk1kh0Vy9wd4lBl9zqt1P9liuYyBLLa9k13j Yt1Ia02y8mR8lUrDQt/eQ2FS4COibUJq5idgVURyGa9h0lEcBQ91D1IZFkBzR/FeF30WkRWaVxLFh iGQwkhKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1faThF-0007Pl-Hj for patchwork-linux-mediatek@patchwork.kernel.org; Tue, 03 Jul 2018 22:22:53 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1faTfl-0005zB-F4; Tue, 03 Jul 2018 22:21:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OMET6WNOL2t5UsgfPZebn2iHGp229ODsitIVvuJKwDw=; b=fcxVw9ejz+xnQxGiIddOVWSbw TN2jNQBcI359M7qOStxp+TpyzdoZJ7aBJakU7G+z0KcNaYEpuqCpAJ3nqSjzSZPjRfHk4lkHO/9aw 1i2b/W6K5SJNUG3fTTfiFoD2v0QVgsRahaINlup1bi7ltSEk0yTC8paQIERCIMXtipp/xq57+4sT2 NB1rogCcnFp4mfehCZkL4Hz/lLrtnF4bqRgFv33Y/BYr5/iBKpirg5cAo+eZ/TwOA4LGahGGJh7H8 km8lebUifvMYZERIItpPxdWXdfgqMO1qpg+brR89W11ql+rwr/KAGhOUidZipt5FxxZ8uQn0lV/34 txNH+hXNw==; Received: from mail.bootlin.com ([62.4.15.54]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1faTMa-0000r3-Ib; Tue, 03 Jul 2018 22:01:35 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 4F9B2208C5; Wed, 4 Jul 2018 00:01:12 +0200 (CEST) Received: from localhost.localdomain (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id DEE0A20933; Wed, 4 Jul 2018 00:01:10 +0200 (CEST) From: Miquel Raynal To: Wenyou Yang , Josh Wu , Tudor Ambarus , Boris Brezillon , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Nicolas Ferre , Alexandre Belloni , Kamal Dasu , Masahiro Yamada , Han Xu , Harvey Hunt , Vladimir Zapolskiy , Sylvain Lemieux , Xiaolei Li , Matthias Brugger , Maxime Ripard , Chen-Yu Tsai , Marc Gonzalez , Mans Rullgard , Stefan Agner Subject: [PATCH v2 21/32] mtd: rawnand: sh_flctl: convert driver to nand_scan() Date: Wed, 4 Jul 2018 00:00:18 +0200 Message-Id: <20180703220029.19565-22-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180703220029.19565-1-miquel.raynal@bootlin.com> References: <20180703220029.19565-1-miquel.raynal@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180703_230132_643147_9F5DB3A0 X-CRM114-Status: GOOD ( 18.32 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bcm-kernel-feedback-list@broadcom.com, linux-mediatek@lists.infradead.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Two helpers have been added to the core to make ECC-related configuration between the detection phase and the final NAND scan. Use these hooks and convert the driver to just use nand_scan() instead of both nand_scan_ident() and nand_scan_tail(). Signed-off-by: Miquel Raynal --- drivers/mtd/nand/raw/sh_flctl.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c index d37d1d3ccbf9..959eb6f5f269 100644 --- a/drivers/mtd/nand/raw/sh_flctl.c +++ b/drivers/mtd/nand/raw/sh_flctl.c @@ -1002,10 +1002,10 @@ static void flctl_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) flctl->index += len; } -static int flctl_chip_init_tail(struct mtd_info *mtd) +static int flctl_chip_attach_chip(struct nand_chip *chip) { + struct mtd_info *mtd = nand_to_mtd(chip); struct sh_flctl *flctl = mtd_to_flctl(mtd); - struct nand_chip *chip = &flctl->chip; if (chip->options & NAND_BUSWIDTH_16) { /* @@ -1200,15 +1200,8 @@ static int flctl_probe(struct platform_device *pdev) flctl_setup_dma(flctl); - ret = nand_scan_ident(flctl_mtd, 1, NULL); - if (ret) - goto err_chip; - - ret = flctl_chip_init_tail(flctl_mtd); - if (ret) - goto err_chip; - - ret = nand_scan_tail(flctl_mtd); + nand->hwcontrol.attach_chip = flctl_chip_attach_chip; + ret = nand_scan(flctl_mtd, 1); if (ret) goto err_chip;