From patchwork Thu Sep 6 12:05:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 10590503 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 8236F921 for ; Thu, 6 Sep 2018 12:06:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684962A6F0 for ; Thu, 6 Sep 2018 12:06:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B6252A73D; Thu, 6 Sep 2018 12:06:58 +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 A86B12A6F0 for ; Thu, 6 Sep 2018 12:06:57 +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=E8Qoe7NR4QMwEsb38KKkm0QyTmPNRrXfQat9AlFEpW4=; b=sK8 l7m8wg7SGBWwdz9V3hnRnkuoNDe5W+ElnvufhLFF7eB6zd6SMw+CDHaXHZlxSkmCAyy+Rep1Iw123 Bae3mET8Ko2MY8/t1ebb+99+KQY4q2yYiGhNZJB848zzt+q7maGVexCsHC0ceH4tXmnHsv790Y4s8 zRr2jqglS6xCzDzuPGLr9TJhtmOPux2UnKwU7FPohPMeZrxtPERF8LBT+rvhfN2Mc1jKIs2r8AbQD mk9zokV7CEDhWStHKBOLrcTpNXhxK7AQa/nylGNB53v8bk094l2W2iXRjteeZRBqtct+PiWkgqaKC E+WRel9UGdypM4wV910wc57O0Cm2fBg==; 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 1fxt3j-0001RO-N2 for patchwork-linux-mediatek@patchwork.kernel.org; Thu, 06 Sep 2018 12:06:51 +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 1fxt2l-0000uu-3J; Thu, 06 Sep 2018 12:06:03 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 7854920797; Thu, 6 Sep 2018 14:05:40 +0200 (CEST) Received: from localhost.localdomain (AAubervilliers-681-1-30-219.w90-88.abo.wanadoo.fr [90.88.15.219]) by mail.bootlin.com (Postfix) with ESMTPSA id 64F3620763; Thu, 6 Sep 2018 14:05:39 +0200 (CEST) From: Boris Brezillon To: Boris Brezillon , Richard Weinberger , Miquel Raynal , linux-mtd@lists.infradead.org Subject: [PATCH v2 00/23] mtd: rawnand: Stop passing mtd_info to drivers Date: Thu, 6 Sep 2018 14:05:12 +0200 Message-Id: <20180906120535.21255-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-20180906_050551_435239_992E0579 X-CRM114-Status: GOOD ( 16.93 ) 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. Not much has changed in this v2. I just rebased on top of nand/next, fixed typos, added A-b/R-b tags, and that's all. 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() 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/nand_toshiba.c | 10 +- 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 +++--- 85 files changed, 1617 insertions(+), 1829 deletions(-)