Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2994162imm; Fri, 20 Jul 2018 08:20:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeeLk81xnD1nY4N4i1iuQOuaqPotN4vcUEGK8mRdhAqzoQ9FokX0qmECcP6RyjOSS4CyJ6e X-Received: by 2002:a63:551e:: with SMTP id j30-v6mr2433483pgb.92.1532100050904; Fri, 20 Jul 2018 08:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532100050; cv=none; d=google.com; s=arc-20160816; b=rrcvQvsaazfgfGd/nycGNcnF3DrhUfotHMdeJ0WquiPMxGAm5n5mAZkebC31ln61W2 vUWajYUKghMWXf9xMVagY8bHG9NbVHQBTKNAcX3N6rCSi4O/7Qiq8wo46EU93DDf72Zc vUhx7ytJ5yIIwj0joTZa4eh9hxxjevMfoFi+V+WqePM/hNfdq1G+jaL2DQP6nQBgsSlM 7NHLzC/BCbuuzu4vBDLuN2mQ8IRFGH9LTcf80kiAWxoZMrm7PieNTEhHQEj0qeF4k9rE fcGTLgMKeEgwCA3UUTh47fmNHeuyNRSa9/owS18P9LrmDvA0oMYguaoYo3bctBwzWHyW xmpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=lT14V9FvpSJ0692j06TVd/XuLBjSm4GHt6LVhAm/tcg=; b=yijToxJrO6M3vYRvpYWT+yj3BtwlVqN443wE6wE/wSqAvXVJSpE18QSD/sL3UNp1ts E5h/gjMu7pZPZylvBmb6nf0mj8BFBSRIB6+I3eW6Asrz3khkqDK4mJuwn59qNVMSkYz8 nb979Z6HG4MtLdfb2mRDyqerWBMFztlvwfhlkoPit6ntwfwJonpu98Jdo5aMfjE334zN BaaPtUXrPCd7K/25hSKyR7VmSZ8gp5CEFFml8po09GahBUasdTG3sQmFiV/mmAjWIFai Sx8D3dTIuaLtVbtFIxl0RvmD1npAgxaiguwCUwNOBZduhQaBUbJXs2HFpw843tIRlwTB GxIw== 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 k7-v6si1793440pgq.548.2018.07.20.08.20.35; Fri, 20 Jul 2018 08:20:50 -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 S2387907AbeGTQEf (ORCPT + 99 others); Fri, 20 Jul 2018 12:04:35 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54178 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732829AbeGTQEf (ORCPT ); Fri, 20 Jul 2018 12:04:35 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4FAB5209D8; Fri, 20 Jul 2018 17:15:49 +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 localhost.localdomain (AAubervilliers-681-1-78-122.w90-88.abo.wanadoo.fr [90.88.20.122]) by mail.bootlin.com (Postfix) with ESMTPSA id 05B0B20893; Fri, 20 Jul 2018 17:15:32 +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 Cc: 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: [PATCH v4 06/35] mtd: rawnand: fsl_ifc: convert driver to nand_scan() Date: Fri, 20 Jul 2018 17:14:58 +0200 Message-Id: <20180720151527.16038-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180720151527.16038-1-miquel.raynal@bootlin.com> References: <20180720151527.16038-1-miquel.raynal@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/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; -- 2.14.1