Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4130081imm; Sat, 21 Jul 2018 10:51:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUtn6Nep5xsssx4J119vfeVsgH92vPR41H5DQyVY0txuuTT87PDQRBJ1UWnwNtKdauNu8Z X-Received: by 2002:a62:3b89:: with SMTP id w9-v6mr6862889pfj.80.1532195479912; Sat, 21 Jul 2018 10:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532195479; cv=none; d=google.com; s=arc-20160816; b=PsCotcPbeSZSF6vHSR2Lpy0lPpT9jEirIYCV+4Iyd7ynDQqdp7nD2SJfuLyW5j7z47 oatJxRRgXseD2O02Q8JGA1AhwS3tXkXLkylSOqyGxdttd2qrbh9szPZuOCxurd14a/M8 c6KBn9Gw5AJJaU2YzzP6UmdcxW0sa1gG9Zcq5+Gny9QJtDg9c9QLtbLzryJuhEBdYKCR TlxnOPcmvfRv84adAj95F13eIpQ6b2uTZW/zh4id2lYGeYCOZNZ5095fnDu/h6IjMCjy HoOAfwUpFPVH1KnaH12wDFTsJJ/6Bpbuu8yzilzGIwd0U9nSNTwEM6kFhz38mGGGxhZt OD9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=4O1r0qslfO/8xq8haiDsbG2sZKUtaTOI7Ju+Q6qi/Uc=; b=OCmjWv3UMKzkPlCxqxHVVQUeeTc9XcMN6mN4tjoOZpsD4jUWvr3napqpTLP7+cID23 zSQ2fDZywRpU6dtiriVToyt67CLFKBCj+aRDlcdDHUrUh1TE3FagptjD3FVnXBaEK/4D 8C0uj1dvJvm0LDyeGSjezvn16ECjhvw/52w8SsD3jxUiq/v64Xn+7fxnOwzw7sW5DjOm AeWtIAJ20MAVhhk5DLDpCD+UpSvR8dPYJcQucu702a88UnquczVeULV2/LIcLfgqTRTc 8uDFjwJuD8XWpnE40t5vFvG/crlM/wTyvLkTSIUXjoGDQZP3SoEVjrW/PtwLeVqlkQOl VoCg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c25-v6si4442739pgm.523.2018.07.21.10.51.05; Sat, 21 Jul 2018 10:51:19 -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; 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 S1728262AbeGUSns (ORCPT + 99 others); Sat, 21 Jul 2018 14:43:48 -0400 Received: from mail.bootlin.com ([62.4.15.54]:50084 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727562AbeGUSns (ORCPT ); Sat, 21 Jul 2018 14:43:48 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 34CEA206F3; Sat, 21 Jul 2018 19:50:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [37.173.79.60]) by mail.bootlin.com (Postfix) with ESMTPSA id CEFB02093C; Sat, 21 Jul 2018 19:49:17 +0200 (CEST) Date: Sat, 21 Jul 2018 19:49:16 +0200 From: Boris Brezillon To: Miquel Raynal Cc: Wenyou Yang , Josh Wu , Tudor Ambarus , 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 , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v4 20/35] mtd: rawnand: sh_flctl: convert driver to nand_scan() Message-ID: <20180721194916.169f5651@bbrezillon> In-Reply-To: <20180720151527.16038-21-miquel.raynal@bootlin.com> References: <20180720151527.16038-1-miquel.raynal@bootlin.com> <20180720151527.16038-21-miquel.raynal@bootlin.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018 17:15:12 +0200 Miquel Raynal wrote: > 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 Reviewed-by: Boris Brezillon > --- > drivers/mtd/nand/raw/sh_flctl.c | 19 ++++++++----------- > 1 file changed, 8 insertions(+), 11 deletions(-) > > diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c > index d37d1d3ccbf9..663c75005ac9 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) { > /* > @@ -1073,6 +1073,10 @@ static int flctl_chip_init_tail(struct mtd_info *mtd) > return 0; > } > > +static const struct nand_controller_ops flctl_nand_controller_ops = { > + .attach_chip = flctl_chip_attach_chip, > +}; > + > static irqreturn_t flctl_handle_flste(int irq, void *dev_id) > { > struct sh_flctl *flctl = dev_id; > @@ -1200,15 +1204,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->dummy_controller.ops = &flctl_nand_controller_ops; > + ret = nand_scan(flctl_mtd, 1); > if (ret) > goto err_chip; >