Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3659448imm; Fri, 20 Jul 2018 23:55:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcW9Ak6maxR+qhIj2kb8VxmlbMTIYU7B20mZknznbGl/4DrCBZU6qTv4kUWY4tIjlpd/5dJ X-Received: by 2002:a17:902:b189:: with SMTP id s9-v6mr4821189plr.188.1532156125541; Fri, 20 Jul 2018 23:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532156125; cv=none; d=google.com; s=arc-20160816; b=sSMNgeV0wWTlBivJRjyBZdvgjetLsDsKGuFiMgO6+1TIm6GiiBDEilGppIV/19ao0E dY0F0wS7Z5dJakjNl86vqaYJ+T9PmyoisbOGhKlWwlemp7B7HLptpHXUSw6lX1bwaGNC YhTDny422pwF1+O/0JktD4hNIVp+anNi1e7AunB62tEzu285FbeO1mmEjzHKF6T1+wi1 J6YnKxiEO2Kcg2jHIW+KD9YaRFNRZMklR3sP/GXQZbZh1xLQAhy102RbgE2MQJikNV9r QKgtuVg5BWN6vOUu0WD6e41K3NKOwVVwcMwrZENN715SwydHnzqmpt8XRDBny6jez5xm n+mg== 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=myj3X+WSUT4LcgL9/u/47nUe2sWCXyrC8QWhB9GMZPE=; b=ZxyjMwkPYH+F6oCZDCQjg8+pi+pbVbiq/5Jzms+UDkB3+FI4qPZpeYCpggt7IlRtQu EuHLgtLIoico7KHiNBFWixOLE9mV3jsvseqRzb/HbEZzQ5Ke7MoGkaTgHlSYrf0AJIuy YK3Ih8YD5tUHeokPydFgPj3ktL51v87AjfBRqpTH/PdcPv8kQWWR8h2yLL2yYC2iDrsh hW0ENDEQa1/rjHHTM8CqmshB2St1rBriFck890o8tamXZD3UcVVCv7BDynus0g5V8hW5 7OtgGiYkAKyOc7g7BCUU6AI9uQhK69O+g83rNIufj1sP4i15wTN9UUgQuZQ9gB1jHZqT PJEg== 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 h16-v6si3500558pgk.449.2018.07.20.23.55.09; Fri, 20 Jul 2018 23:55:25 -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 S1727638AbeGUHpK (ORCPT + 99 others); Sat, 21 Jul 2018 03:45:10 -0400 Received: from mail.bootlin.com ([62.4.15.54]:42837 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbeGUHpK (ORCPT ); Sat, 21 Jul 2018 03:45:10 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id E3AC5207B4; Sat, 21 Jul 2018 08:53:29 +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.170.141.1]) by mail.bootlin.com (Postfix) with ESMTPSA id B235D2069C; Sat, 21 Jul 2018 08:53:27 +0200 (CEST) Date: Sat, 21 Jul 2018 08:53:25 +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 06/35] mtd: rawnand: fsl_ifc: convert driver to nand_scan() Message-ID: <20180721085325.0d9dbf2f@bbrezillon> In-Reply-To: <20180720151527.16038-7-miquel.raynal@bootlin.com> References: <20180720151527.16038-1-miquel.raynal@bootlin.com> <20180720151527.16038-7-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:14:58 +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/fsl_ifc_nand.c | 19 ++++++++----------- > 1 file changed, 8 insertions(+), 11 deletions(-) > > diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c > index 96130d91e32c..24f59d0066af 100644 > --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c > +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c > @@ -714,9 +714,9 @@ static int fsl_ifc_write_page(struct mtd_info *mtd, struct nand_chip *chip, > return nand_prog_page_end_op(chip); > } > > -static int fsl_ifc_chip_init_tail(struct mtd_info *mtd) > +static int fsl_ifc_attach_chip(struct nand_chip *chip) > { > - struct nand_chip *chip = mtd_to_nand(mtd); > + struct mtd_info *mtd = nand_to_mtd(chip); > struct fsl_ifc_mtd *priv = nand_get_controller_data(chip); > > dev_dbg(priv->dev, "%s: nand->numchips = %d\n", __func__, > @@ -757,6 +757,10 @@ static int fsl_ifc_chip_init_tail(struct mtd_info *mtd) > return 0; > } > > +static const struct nand_controller_ops fsl_ifc_controller_ops = { > + .attach_chip = fsl_ifc_attach_chip, > +}; > + > static void fsl_ifc_sram_init(struct fsl_ifc_mtd *priv) > { > struct fsl_ifc_ctrl *ctrl = priv->ctrl; > @@ -1046,15 +1050,8 @@ static int fsl_ifc_nand_probe(struct platform_device *dev) > if (ret) > goto err; > > - ret = nand_scan_ident(mtd, 1, NULL); > - if (ret) > - goto err; > - > - ret = fsl_ifc_chip_init_tail(mtd); > - if (ret) > - goto err; > - > - ret = nand_scan_tail(mtd); > + priv->chip.controller->ops = &fsl_ifc_controller_ops; > + ret = nand_scan(mtd, 1); > if (ret) > goto err; >