All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/62] mtd: rawnand: Get rid of nand_release()
@ 2020-05-10 12:11 Miquel Raynal
  2020-05-10 12:11 ` [PATCH 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
                   ` (62 more replies)
  0 siblings, 63 replies; 95+ messages in thread
From: Miquel Raynal @ 2020-05-10 12:11 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Maxim Levitsky, Jonathan Corbet, Kamal Dasu, Stefan Agner,
	Paul Cercueil, Masahiro Yamada, Boris Brezillon, Harvey Hunt,
	Miquel Raynal, Han Xu, Xiaolei Li, Brian Norris, Piotr Sroka

Hello,

The main goal of this big cleanup series is to get rid of
nand_release(). I am always confused when it comes to use either
nand_cleanup() or nand_release() and I need to check the code in the
core, which is a sign of the API being badly designed.

Historically, there was a "nand_release()" helper only, doing the MTD
device unregistration and cleaning/freeing all objects belonging to
the NAND core. Later (v4.9), nand_cleanup() was been added to take
care of all the NAND cleanup, and was called directly by
nand_release(). This new helper was very useful to cleanup all the
NAND core objects in one go on _probe() error (after a successful
nand_scan()).

Unfortunately, because of the lack of symmetry in the API, a lot of
people also used nand_release wrongly in the _probe() error path.

So now, instead of:

        nand_release(chip);

I would like people to use:

        ret = mtd_device_unregister(mtd);
	WARN_ON(ret);
	nand_cleanup(chip);

Note: as it is currently not possible to handle properly an error on
mtd_device_unregister(), WARN_ON() will at least inform the user.

All of you receiving this cover letter will at least receive one patch
applying this change to the driver you are maintaining.

Thanks,
Miquèl


Miquel Raynal (62):
  mtd: rawnand: ams-delta: Stop using nand_release()
  mtd: rawnand: au1550nd: Stop using nand_release()
  mtd: rawnand: bcm47xx: Stop using nand_release()
  mtd: rawnand: brcmnand: Stop using nand_release()
  mtd: rawnand: cadence: Stop using nand_release()
  mtd: rawnand: cafe: Stop using nand_release()
  mtd: rawnand: cmx270: Stop using nand_release()
  mtd: rawnand: cs553x: Stop using nand_release()
  mtd: rawnand: davinci: Stop using nand_release()
  mtd: rawnand: denali: Delete items from the list in the _remove() path
  mtd: rawnand: denali: Stop using nand_release()
  mtd: rawnand: diskonchip: Fix the probe error path
  mtd: rawnand: diskonchip: Stop using nand_release()
  mtd: rawnand: fsl_elbc: Stop using nand_release()
  mtd: rawnand: fsl_ifc: Stop using nand_release()
  mtd: rawnand: fsl_upm: Stop using nand_release()
  mtd: rawnand: fsmc: Stop using nand_release()
  mtd: rawnand: gpio: Stop using nand_release()
  mtd: rawnand: gpmi: Stop using nand_release()
  mtd: rawnand: hisi504: Stop using nand_release()
  mtd: rawnand: ingenic: Fix the probe error path
  mtd: rawnand: ingenic: Stop using nand_release()
  mtd: rawnand: lpc32xx_mlc: Stop using nand_release()
  mtd: rawnand: lpc32xx_slc: Stop using nand_release()
  mtd: rawnand: marvell: Stop using nand_release()
  mtd: rawnand: mpc5121: Stop using nand_release()
  mtd: rawnand: mtk: Fix the probe error path
  mtd: rawnand: mtk: Stop using nand_release()
  mtd: rawnand: mxc: Stop using nand_release()
  mtd: rawnand: mxic: Stop using nand_release()
  mtd: rawnand: ndfc: Stop using nand_release()
  mtd: rawnand: omap2: Stop using nand_release()
  mtd: rawnand: orion: Fix the probe error path
  mtd: rawnand: orion: Stop using nand_release()
  mtd: rawnand: oxnas: Keep track of registered devices
  mtd: rawnand: oxnas: Fix the probe error path
  mtd: rawnand: oxnas: Unregister all devices on error
  mtd: rawnand: oxnas: Release all devices in the _remove() path
  mtd: rawnand: oxnas: Stop using nand_release()
  mtd: rawnand: pasemi: Fix the probe error path
  mtd: rawnand: pasemi: Stop using nand_release()
  mtd: rawnand: plat_nand: Fix the probe error path
  mtd: rawnand: plat_nand: Stop using nand_release()
  mtd: rawnand: qcom: Stop using nand_release()
  mtd: rawnand: r852: Stop using nand_release()
  mtd: rawnand: s3c2410: Stop using nand_release()
  mtd: rawnand: sh_flctl: Stop using nand_release()
  mtd: rawnand: sharpsl: Fix the probe error path
  mtd: rawnand: sharpsl: Stop using nand_release()
  mtd: ranwnand: socrates: Fix the probe error path
  mtd: rawnand: socrates: Stop using nand_release()
  mtd: rawnand: stm32_fmc2: Stop using nand_release()
  mtd: rawnand: sunxi: Fix the probe error path
  mtd: rawnand: sunxi: Stop using nand_release()
  mtd: rawnand: tango: Stop using nand_release()
  mtd: rawnand: tmio: Fix the probe error path
  mtd: rawnand: tmio: Stop using nand_release()
  mtd: rawnand: txx9ndfmc: Stop using nand_release()
  mtd: rawnand: vf610: Stop using nand_release()
  mtd: rawnand: xway: Fix the probe error path
  mtd: rawnand: xway: Stop using nand_release()
  mtd: rawnand: Stop using nand_release()

 Documentation/driver-api/mtdnand.rst          |  6 ++--
 drivers/mtd/nand/raw/ams-delta.c              |  5 ++-
 drivers/mtd/nand/raw/au1550nd.c               |  5 ++-
 drivers/mtd/nand/raw/bcm47xxnflash/main.c     |  6 +++-
 drivers/mtd/nand/raw/brcmnand/brcmnand.c      | 10 ++++--
 .../mtd/nand/raw/cadence-nand-controller.c    |  7 +++-
 drivers/mtd/nand/raw/cafe_nand.c              |  5 ++-
 drivers/mtd/nand/raw/cmx270_nand.c            |  6 +++-
 drivers/mtd/nand/raw/cs553x_nand.c            |  6 ++--
 drivers/mtd/nand/raw/davinci_nand.c           |  6 +++-
 drivers/mtd/nand/raw/denali.c                 | 13 ++++++--
 drivers/mtd/nand/raw/diskonchip.c             | 12 +++----
 drivers/mtd/nand/raw/fsl_elbc_nand.c          |  7 +++-
 drivers/mtd/nand/raw/fsl_ifc_nand.c           |  7 +++-
 drivers/mtd/nand/raw/fsl_upm.c                |  9 +++--
 drivers/mtd/nand/raw/fsmc_nand.c              |  7 +++-
 drivers/mtd/nand/raw/gpio.c                   |  6 +++-
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c    |  6 +++-
 drivers/mtd/nand/raw/hisi504_nand.c           |  6 +++-
 .../mtd/nand/raw/ingenic/ingenic_nand_drv.c   | 17 ++++++----
 drivers/mtd/nand/raw/lpc32xx_mlc.c            |  7 +++-
 drivers/mtd/nand/raw/lpc32xx_slc.c            |  6 +++-
 drivers/mtd/nand/raw/marvell_nand.c           |  7 +++-
 drivers/mtd/nand/raw/mpc5121_nfc.c            |  5 ++-
 drivers/mtd/nand/raw/mtk_nand.c               | 17 ++++++----
 drivers/mtd/nand/raw/mxc_nand.c               |  6 +++-
 drivers/mtd/nand/raw/mxic_nand.c              |  7 +++-
 drivers/mtd/nand/raw/nand_base.c              | 12 -------
 drivers/mtd/nand/raw/ndfc.c                   |  8 +++--
 drivers/mtd/nand/raw/omap2.c                  |  8 +++--
 drivers/mtd/nand/raw/orion_nand.c             |  8 +++--
 drivers/mtd/nand/raw/oxnas_nand.c             | 33 +++++++++++++------
 drivers/mtd/nand/raw/pasemi_nand.c            |  9 +++--
 drivers/mtd/nand/raw/plat_nand.c              |  8 +++--
 drivers/mtd/nand/raw/qcom_nandc.c             | 11 +++++--
 drivers/mtd/nand/raw/r852.c                   |  6 ++--
 drivers/mtd/nand/raw/s3c2410.c                |  3 +-
 drivers/mtd/nand/raw/sh_flctl.c               |  6 +++-
 drivers/mtd/nand/raw/sharpsl.c                | 14 +++++---
 drivers/mtd/nand/raw/socrates_nand.c          |  8 +++--
 drivers/mtd/nand/raw/stm32_fmc2_nand.c        |  6 +++-
 drivers/mtd/nand/raw/sunxi_nand.c             | 11 +++++--
 drivers/mtd/nand/raw/tango_nand.c             | 11 +++++--
 drivers/mtd/nand/raw/tmio_nand.c              |  8 +++--
 drivers/mtd/nand/raw/txx9ndfmc.c              |  6 ++--
 drivers/mtd/nand/raw/vf610_nfc.c              |  6 +++-
 drivers/mtd/nand/raw/xway_nand.c              |  8 +++--
 include/linux/mtd/bbm.h                       |  2 +-
 include/linux/mtd/rawnand.h                   |  2 --
 49 files changed, 290 insertions(+), 111 deletions(-)

-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 95+ messages in thread

end of thread, other threads:[~2020-05-13  7:59 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-10 12:11 [PATCH 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 05/62] mtd: rawnand: cadence: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 06/62] mtd: rawnand: cafe: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 07/62] mtd: rawnand: cmx270: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 08/62] mtd: rawnand: cs553x: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 09/62] mtd: rawnand: davinci: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
2020-05-11  2:47   ` Masahiro Yamada
2020-05-10 12:11 ` [PATCH 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
2020-05-11  2:49   ` Masahiro Yamada
2020-05-10 12:11 ` [PATCH 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
2020-05-10 12:11   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-13  7:59     ` Miquel Raynal
2020-05-10 12:11 ` [PATCH 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 17/62] mtd: rawnand: fsmc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 18/62] mtd: rawnand: gpio: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 19/62] mtd: rawnand: gpmi: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 20/62] mtd: rawnand: hisi504: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
2020-05-10 12:11   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:11 ` [PATCH 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 25/62] mtd: rawnand: marvell: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
2020-05-10 12:11   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:11 ` [PATCH 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 29/62] mtd: rawnand: mxc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 30/62] mtd: rawnand: mxic: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 31/62] mtd: rawnand: ndfc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 32/62] mtd: rawnand: omap2: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
2020-05-10 12:11   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:11 ` [PATCH 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
2020-05-10 12:11 ` [PATCH 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
2020-05-10 12:11   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:11 ` [PATCH 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
2020-05-10 12:11 ` [PATCH 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
2020-05-10 12:11 ` [PATCH 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
2020-05-10 12:11   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:11 ` [PATCH 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
2020-05-10 12:12   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:12 ` [PATCH 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 44/62] mtd: rawnand: qcom: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 45/62] mtd: rawnand: r852: " Miquel Raynal
2020-05-11 10:33   ` Sergei Shtylyov
2020-05-11 13:10     ` Miquel Raynal
2020-05-12 20:09       ` Sergei Shtylyov
2020-05-10 12:12 ` [PATCH 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
2020-05-10 12:12   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:12 ` [PATCH 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 50/62] mtd: ranwnand: socrates: Fix the probe error path Miquel Raynal
2020-05-10 12:12   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:12 ` [PATCH 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
2020-05-13  7:48   ` Christophe Kerello
2020-05-10 12:12 ` [PATCH 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
2020-05-10 12:12   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:12 ` [PATCH 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 55/62] mtd: rawnand: tango: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
2020-05-10 12:12   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:12 ` [PATCH 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 59/62] mtd: rawnand: vf610: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
2020-05-10 12:12   ` Miquel Raynal
2020-05-13  0:49   ` Sasha Levin
2020-05-10 12:12 ` [PATCH 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 62/62] mtd: rawnand: " Miquel Raynal
2020-05-11  2:46 ` [PATCH 00/62] mtd: rawnand: Get rid of nand_release() Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.