Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2993973imm; Fri, 20 Jul 2018 08:20:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd8J6NZ9GU9sCImugsDERICdO38pcQYTSshR+qqKwvqb6ZBS/krrRfx+R4MPL4Ui8+L2f7f X-Received: by 2002:a17:902:546:: with SMTP id 64-v6mr2540500plf.232.1532100039707; Fri, 20 Jul 2018 08:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532100039; cv=none; d=google.com; s=arc-20160816; b=KLGA2ki/L9PvjbXGxaZzfaK1swF/fniKbgy4MAoBlPnswXoEaFNrvRdLcYay6CqI9R xx1uAn9AYd9fgRiWACTApgsMz/9JlEkHiSvITjcSJwWaREAhcKo+r7xBvEx93tNLZh4/ Xs7UsA1DaPB4KSXLZWuL4f6sQ9pnVa1/PhM/xM3KjDxDKiY8W1rW1FoCafffEYlT04H/ dl8EV08fKYJIM6OrSwh1Cm1CQk5rVW/WixIhXSYqAIQKVzxtJJwQTmOww/okxTnLDL/z Jt/5Qc6EB1y2ymGQv0uS7ETbaaAvYysGxRRBH/iLMcKgacheO5Qo8VScWbnMAKEjWair Oq2g== 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=vWHyNODYS8YRw3YqOqf6SPs9DmoScyf3eAp4Vlgh+nc=; b=EPMflBFr7euJJU7kalsRRXDFW3vl+2I7z0Iv+xacQ+x6pgyRmV6Va3x4jiuyHhIlaw JP7auWuNWB7AwsU7Rj2O7BF4cx/0+YnrD8F+ZRVXreWLz7JFuhWKZiwXGqLwO6A2knyW GbsOYHce1E1FtJv76DDkJB7DIUVRKAI8xfnv5lX88RyBQYH3vzn9JN/SFmuase5YYHTO Sx7nBWbKPjAlo6H9eCbGNjWBmHzoKTn8HxBYiZqdgNaSIyqiLIHF3GDcVkvtKhtahijr K3htoJETIHPaNBZAqVXmeyetfks+OrNWO+/UpY/GbyM/JOs+plX2mKxT4/1fYq+8oAs6 +Kzw== 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 p123-v6si1828795pfg.281.2018.07.20.08.20.25; Fri, 20 Jul 2018 08:20:39 -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 S2387926AbeGTQEf (ORCPT + 99 others); Fri, 20 Jul 2018 12:04:35 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54185 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732981AbeGTQEe (ORCPT ); Fri, 20 Jul 2018 12:04:34 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 524C2209D6; 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 6D72020876; Fri, 20 Jul 2018 17:15:31 +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 05/35] mtd: rawnand: fsl_elbc: convert driver to nand_scan() Date: Fri, 20 Jul 2018 17:14:57 +0200 Message-Id: <20180720151527.16038-6-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_elbc_nand.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c index 0aa54a949653..44893e49b386 100644 --- a/drivers/mtd/nand/raw/fsl_elbc_nand.c +++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c @@ -637,9 +637,9 @@ static int fsl_elbc_wait(struct mtd_info *mtd, struct nand_chip *chip) return (elbc_fcm_ctrl->mdr & 0xff) | NAND_STATUS_WP; } -static int fsl_elbc_chip_init_tail(struct mtd_info *mtd) +static int fsl_elbc_attach_chip(struct nand_chip *chip) { - struct nand_chip *chip = mtd_to_nand(mtd); + struct mtd_info *mtd = nand_to_mtd(chip); struct fsl_elbc_mtd *priv = nand_get_controller_data(chip); struct fsl_lbc_ctrl *ctrl = priv->ctrl; struct fsl_lbc_regs __iomem *lbc = ctrl->regs; @@ -706,6 +706,10 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd) return 0; } +static const struct nand_controller_ops fsl_elbc_controller_ops = { + .attach_chip = fsl_elbc_attach_chip, +}; + static int fsl_elbc_read_page(struct mtd_info *mtd, struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { @@ -910,15 +914,8 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev) if (ret) goto err; - ret = nand_scan_ident(mtd, 1, NULL); - if (ret) - goto err; - - ret = fsl_elbc_chip_init_tail(mtd); - if (ret) - goto err; - - ret = nand_scan_tail(mtd); + priv->chip.controller->ops = &fsl_elbc_controller_ops; + ret = nand_scan(mtd, 1); if (ret) goto err; -- 2.14.1