Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2992780imm; Fri, 20 Jul 2018 08:19:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6bsPik/U/mSINx7dplLfNR0T4+DoDCfvx90zTgXQAfOoU9BXSPNxETETMkcFS2pViWnot X-Received: by 2002:a63:f414:: with SMTP id g20-v6mr2455617pgi.407.1532099965093; Fri, 20 Jul 2018 08:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532099965; cv=none; d=google.com; s=arc-20160816; b=0R4y6CPKDPPux7n+RcBfVmvP3jNn387qpCyK9Zxu3ElkwhaKznkeeb+ymko/FFoyj5 Ijnaua+MUVwgDvnhCZWLyRZF9ONSIFuwbE0W6F7tdzNp0CHjB6EsuN+AS57BRXvLTEkN obzBl0WfeE84z13e2pihUI5TdKoN9Lfw888dDkLc4ISO/CSzHJ7QJuWae+eAEHXEBAsZ eUtMfpWVxSI4+0tl6ywWL/gZi6xno6gpW61Mb5ox+v3pGQ49d+HjYnZNV6orReKeOGsi wufiP0bB+ojRbexyRNE8aY7THFDbWU1RjLYmaXNjKs185BMWr9MkJjtQqNRhQ8JDRlN5 bEUw== 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=eIroXvjqSOfZEFgVBm9dwY1CuIrCLJAfVOPB8uhuNoI=; b=OAxIZFb2xDuSOUH27juD0ozaVyOl+ra/L7KHAvghm8NUVbjXuBE18s6G20EDXRxukm gWi68QMpRLos2LEpSaeeAx4d5nKpsKa6HQbX0mrUMUl3U9+CYMtGlDgGHa54TEt7ciAs oyaoE/1l5Lg99cAqU0dEWP/TTtl0wYEdIr+j58Zr3ZRV6vEN0g1HYryzepij4e0ZAnnm 4qYHeulO49lkVVDP2iJHCuqlS50DjqR4VjhG1xI7bmKjdSp9QCwe4tNifbwOSe93wxao oRXrAI79G848wL/XOLb5EMH0zqwhuP1J+BIrahRMC5mr1f1Rwp6s/HKzDIXLamoRTDPP ENlg== 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 w25-v6si2003037pfa.359.2018.07.20.08.19.10; Fri, 20 Jul 2018 08:19: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 S2388345AbeGTQGI (ORCPT + 99 others); Fri, 20 Jul 2018 12:06:08 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54496 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388050AbeGTQEq (ORCPT ); Fri, 20 Jul 2018 12:04:46 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id EB73B203EC; Fri, 20 Jul 2018 17:15:59 +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 08D662073D; Fri, 20 Jul 2018 17:15:40 +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 20/35] mtd: rawnand: sh_flctl: convert driver to nand_scan() Date: Fri, 20 Jul 2018 17:15:12 +0200 Message-Id: <20180720151527.16038-21-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/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; -- 2.14.1