From patchwork Fri Aug 17 16:08:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 10569141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86EEA5A4 for ; Fri, 17 Aug 2018 16:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75E582BDD2 for ; Fri, 17 Aug 2018 16:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 680BA2BDD5; Fri, 17 Aug 2018 16:09:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CDEFF2BDD2 for ; Fri, 17 Aug 2018 16:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=5zC5WjCvRAYRVcrZjZllE3rS0PqVcnCt2MG/UMuzk7o=; b=KTZ ljEq3cQhAq3ACQU+bne+9CVD2MB4wQAoZQ4yd4+h/3QqQBvOlc+JTSS/wALv3HbvT/IDBEjLUnOrE AlmKLEaNPuG6ussQIiWGWjXnjk0kTu09/dmG+tRugOB48cv0HWd4+4C3PFCQsc0v2b7muH9MgJWEz 5DvOP5fq4Ic/nXVHJUXgq7HXW7Qt24AQc/HNEQvTg3nIB5GpzMkrfOrQBJyHLv66/4DM9jSHHU7cV 1gyJrSNRUTQiOb5yrvUWz8E7L7BhkB36Td5tlNmBS+C3vzCwLuZIuxIfblWH6r7vZwFBEshacC7QY ddhKACvLu2cyPz0yQZ7lox//zMqJmaw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fqhJt-0004jl-Nd for patchwork-linux-mediatek@patchwork.kernel.org; Fri, 17 Aug 2018 16:09:49 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fqhJh-0004Y2-GE; Fri, 17 Aug 2018 16:09:39 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 5AC23207B3; Fri, 17 Aug 2018 18:09:25 +0200 (CEST) Received: from localhost.localdomain (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 10B5F203EC; Fri, 17 Aug 2018 18:09:24 +0200 (CEST) From: Boris Brezillon To: Boris Brezillon , Richard Weinberger , Miquel Raynal , linux-mtd@lists.infradead.org Subject: [PATCH 00/23] mtd: rawnand: Stop passing mtd_info to drivers Date: Fri, 17 Aug 2018 18:08:59 +0200 Message-Id: <20180817160922.6224-1-boris.brezillon@bootlin.com> X-Mailer: git-send-email 2.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180817_090937_814788_943BC7F7 X-CRM114-Status: GOOD ( 16.62 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Alexandre Belloni , Rich Felker , linux-doc@vger.kernel.org, Tony Lindgren , linux-mips@linux-mips.org, Stefan Agner , Masahiro Yamada , Mans Rullgard , Robert Jarzmik , Jason Cooper , devel@driverdev.osuosl.org, Maxime Ripard , Maxim Levitsky , Yoshinori Sato , Aaro Koskinen , Gregory Clement , linux-sh@vger.kernel.org, Lukasz Majewski , Neil Armstrong , Marek Vasut , Chen-Yu Tsai , NXP Linux Team , Sylvain Lemieux , Sebastian Hesselbarth , Alexander Clouter , Wan ZongShun , Marc Gonzalez , Sascha Hauer , Haojian Zhuang , Vladimir Zapolskiy , Harvey Hunt , Krzysztof Halasa , Kamal Dasu , Matthias Brugger , Han Xu , Xiaolei Li , linux-omap@vger.kernel.org, Alexander Sverdlin , linux-arm-kernel@lists.infradead.org, Brian Norris , David Woodhouse , Jonathan Corbet , Nicolas Ferre , Ralf Baechle , Hartley Sweeten , Pengutronix Kernel Team , Greg Kroah-Hartman , Fabio Estevam , linux-mediatek@lists.infradead.org, Imre Kaloz , Shawn Guo , Daniel Mack MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, This is the first set of patches aiming at cleaning the raw NAND API. This one focuses on inconsistencies we have in the API + the nand_chip and nand_ecc_ctrl interfaces. Some functions/hooks are passed a nand_chip object, some are passed an mtd_info object and some are passed both. Since mtd_info can be extracted from nand_chip, we can simply always pass a nand_chip and make things consistent. Hopefully with these changes merged we'll stop seeing new drivers reproducing the same mistake (passing both mtd_info and nand_chip or using mtd_info where nand_chip is more appropriate). For those who want to see what's in the pipe, here is a branch [1] containing all the cleanups I plan to merge. Regards, Boris [1]https://github.com/bbrezillon/linux-0day/commits/nand/api-cleanup Boris Brezillon (23): mtd: rawnand: plat_nand: Pass a nand_chip object to all platform_nand_ctrl hooks mtd: rawnand: Pass a nand_chip object to nand_scan() & co mtd: rawnand: Pass a nand_chip object to nand_release() mtd: rawnand: Pass a nand_chip object to nand_wait_ready() mtd: rawnand: Pass a nand_chip object to ecc->hwctl() mtd: rawnand: Pass a nand_chip object to ecc->calculate() mtd: rawnand: Pass a nand_chip object to ecc->correct() mtd: rawnand: Pass a nand_chip object to ecc->read_xxx() hooks mtd: rawnand: Pass a nand_chip object to ecc->write_xxx() hooks mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks mtd: rawnand: Pass a nand_chip object to chip->write_xxx() hooks mtd: rawnand: Pass a nand_chip object to chip->select_chip() mtd: rawnand: Pass a nand_chip object to chip->block_xxx() hooks mtd: rawnand: Pass a nand_chip object to chip->cmd_ctrl() mtd: rawnand: Pass a nand_chip object to chip->dev_ready() mtd: rawnand: Pass a nand_chip object to chip->cmdfunc() mtd: rawnand: Pass a nand_chip object to chip->waitfunc() mtd: rawnand: Pass a nand_chip object to chip->erase() mtd: rawnand: Pass a nand_chip object to chip->{get,set}_features() mtd: rawnand: Pass a nand_chip object to chip->setup_read_retry() mtd: rawnand: Pass a nand_chip object to chip->setup_data_interface() mtd: rawnand: Pass a nand_chip object to all nand_xxx_bbt() helpers mtd: rawnand: Pass a nand_chip object nand_erase_nand() Documentation/driver-api/mtdnand.rst | 4 +- arch/arm/mach-ep93xx/snappercl15.c | 7 +- arch/arm/mach-ep93xx/ts72xx.c | 7 +- arch/arm/mach-imx/mach-qong.c | 11 +- arch/arm/mach-ixp4xx/ixdp425-setup.c | 3 +- arch/arm/mach-omap1/board-fsample.c | 2 +- arch/arm/mach-omap1/board-h2.c | 2 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-nand.c | 3 +- arch/arm/mach-omap1/board-perseus2.c | 2 +- arch/arm/mach-omap1/common.h | 2 +- arch/arm/mach-orion5x/ts78xx-setup.c | 18 +- arch/arm/mach-pxa/balloon3.c | 8 +- arch/arm/mach-pxa/em-x270.c | 5 +- arch/arm/mach-pxa/palmtx.c | 5 +- arch/mips/alchemy/devboards/db1200.c | 5 +- arch/mips/alchemy/devboards/db1300.c | 5 +- arch/mips/alchemy/devboards/db1550.c | 5 +- arch/mips/netlogic/xlr/platform-flash.c | 4 +- arch/mips/pnx833x/common/platform.c | 3 +- arch/mips/rb532/devices.c | 5 +- arch/sh/boards/mach-migor/setup.c | 6 +- drivers/mtd/nand/raw/ams-delta.c | 24 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 74 ++- drivers/mtd/nand/raw/au1550nd.c | 70 ++- drivers/mtd/nand/raw/bcm47xxnflash/main.c | 2 +- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 38 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 78 +-- drivers/mtd/nand/raw/cafe_nand.c | 56 +-- drivers/mtd/nand/raw/cmx270_nand.c | 20 +- drivers/mtd/nand/raw/cs553x_nand.c | 33 +- drivers/mtd/nand/raw/davinci_nand.c | 59 +-- drivers/mtd/nand/raw/denali.c | 87 ++-- drivers/mtd/nand/raw/diskonchip.c | 116 ++--- drivers/mtd/nand/raw/docg4.c | 83 ++-- drivers/mtd/nand/raw/fsl_elbc_nand.c | 52 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 46 +- drivers/mtd/nand/raw/fsl_upm.c | 34 +- drivers/mtd/nand/raw/fsmc_nand.c | 42 +- drivers/mtd/nand/raw/gpio.c | 13 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c | 3 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 99 ++-- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h | 2 +- drivers/mtd/nand/raw/hisi504_nand.c | 44 +- drivers/mtd/nand/raw/jz4740_nand.c | 39 +- drivers/mtd/nand/raw/jz4780_nand.c | 30 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 47 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 67 ++- drivers/mtd/nand/raw/marvell_nand.c | 74 ++- drivers/mtd/nand/raw/mpc5121_nfc.c | 40 +- drivers/mtd/nand/raw/mtk_nand.c | 81 ++- drivers/mtd/nand/raw/mxc_nand.c | 85 ++-- drivers/mtd/nand/raw/nand_base.c | 606 ++++++++++------------- drivers/mtd/nand/raw/nand_bbt.c | 21 +- drivers/mtd/nand/raw/nand_bch.c | 10 +- drivers/mtd/nand/raw/nand_ecc.c | 14 +- drivers/mtd/nand/raw/nand_hynix.c | 12 +- drivers/mtd/nand/raw/nand_micron.c | 16 +- drivers/mtd/nand/raw/nandsim.c | 28 +- drivers/mtd/nand/raw/ndfc.c | 25 +- drivers/mtd/nand/raw/nuc900_nand.c | 27 +- drivers/mtd/nand/raw/omap2.c | 148 +++--- drivers/mtd/nand/raw/orion_nand.c | 14 +- drivers/mtd/nand/raw/oxnas_nand.c | 19 +- drivers/mtd/nand/raw/pasemi_nand.c | 19 +- drivers/mtd/nand/raw/plat_nand.c | 6 +- drivers/mtd/nand/raw/qcom_nandc.c | 52 +- drivers/mtd/nand/raw/r852.c | 54 +- drivers/mtd/nand/raw/s3c2410.c | 72 +-- drivers/mtd/nand/raw/sh_flctl.c | 40 +- drivers/mtd/nand/raw/sharpsl.c | 24 +- drivers/mtd/nand/raw/sm_common.c | 5 +- drivers/mtd/nand/raw/socrates_nand.c | 32 +- drivers/mtd/nand/raw/sunxi_nand.c | 82 ++- drivers/mtd/nand/raw/tango_nand.c | 67 ++- drivers/mtd/nand/raw/tegra_nand.c | 36 +- drivers/mtd/nand/raw/tmio_nand.c | 53 +- drivers/mtd/nand/raw/txx9ndfmc.c | 38 +- drivers/mtd/nand/raw/vf610_nfc.c | 43 +- drivers/mtd/nand/raw/xway_nand.c | 27 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 33 +- include/linux/mtd/nand_bch.h | 11 +- include/linux/mtd/nand_ecc.h | 8 +- include/linux/mtd/rawnand.h | 142 +++--- 84 files changed, 1612 insertions(+), 1824 deletions(-)