public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/20] mtd: Convert to platform remove callback returning void
@ 2023-10-08 20:01 Uwe Kleine-König
  2023-10-08 20:01 ` [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning Uwe Kleine-König
                   ` (20 more replies)
  0 siblings, 21 replies; 51+ messages in thread
From: Uwe Kleine-König @ 2023-10-08 20:01 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: David Woodhouse, Atsushi Nemoto, Andrew Morton, linux-mtd, kernel,
	linux-kbuild, Robert Jarzmik, Joern Engel, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, linuxppc-dev, Yangtao Li,
	Rob Herring, Li Zetao, Christophe JAILLET, Tudor Ambarus,
	Hui Tang, Zheng Yongjun, Heiko Stuebner, Linus Walleij,
	Pratyush Yadav, Michael Walle, Vladimir Zapolskiy,
	linux-arm-kernel

Hello,

this series converts all platform drivers below drivers/mtd to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver
core doesn't (and cannot) cope for errors during remove. The only effect
of a non-zero return value in .remove() is that the driver core emits a
warning. The device is removed anyhow and an early return from .remove()
usually yields resource leaks and/or use-after-free bugs.

All drivers touched here returned zero unconditionally in their remove
callback, so they could all be converted trivially to .remove_new().

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

As an added bonus the series starts with a minor fix and a
simplification of the txx9ndfmc driver.

The only interdependencies in this series is between the three txx9ndfmc
patches. As there are still quite a few drivers to convert, I'm happy
about every patch that makes it in. So even if there is a merge conflict
with one patch until you apply (or a different concern that doesn't
apply to all patches), please apply the remainder of this series anyhow.
I'll come back to the part that you (maybe) skipped at a later point.

Best regards
Uwe

Uwe Kleine-König (20):
  mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent
    section mismatch warning
  mtd: rawnand: txx9ndfmc: Drop if block with always false condition
  mtd: bcm47xxsflash: Convert to platform remove callback returning void
  mtd: docg3: Convert to platform remove callback returning void
  mtd: phram: Convert to platform remove callback returning void
  mtd: powernv_flash: Convert to platform remove callback returning void
  mtd: spear_smi: Convert to platform remove callback returning void
  mtd: st_spi_fsm: Convert to platform remove callback returning void
  mtd: hyperbus: hbmc-am654: Convert to platform remove callback
    returning void
  mtd: hyperbus: rpc-if: Convert to platform remove callback returning
    void
  mtd: lpddr2_nvm: Convert to platform remove callback returning void
  mtd: maps: lantiq-flash: Convert to platform remove callback returning
    void
  mtd: maps: physmap-core: Convert to platform remove callback returning
    void
  mtd: maps: plat-ram: Convert to platform remove callback returning
    void
  mtd: maps: pxa2xx-flash: Convert to platform remove callback returning
    void
  mtd: maps: sa1100-flash: Convert to platform remove callback returning
    void
  mtd: maps: sun_uflash: Convert to platform remove callback returning
    void
  mtd: rawnand: txx9ndfmc: Convert to platform remove callback returning
    void
  mtd: spi-nor: hisi-sfc: Convert to platform remove callback returning
    void
  mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning
    void

 drivers/mtd/devices/bcm47xxsflash.c         |  6 ++----
 drivers/mtd/devices/docg3.c                 |  5 ++---
 drivers/mtd/devices/phram.c                 |  6 ++----
 drivers/mtd/devices/powernv_flash.c         |  6 ++----
 drivers/mtd/devices/spear_smi.c             |  6 ++----
 drivers/mtd/devices/st_spi_fsm.c            |  6 ++----
 drivers/mtd/hyperbus/hbmc-am654.c           |  6 ++----
 drivers/mtd/hyperbus/rpc-if.c               |  6 ++----
 drivers/mtd/lpddr/lpddr2_nvm.c              |  6 ++----
 drivers/mtd/maps/lantiq-flash.c             |  6 ++----
 drivers/mtd/maps/physmap-core.c             |  5 ++---
 drivers/mtd/maps/plat-ram.c                 |  8 +++-----
 drivers/mtd/maps/pxa2xx-flash.c             |  5 ++---
 drivers/mtd/maps/sa1100-flash.c             |  6 ++----
 drivers/mtd/maps/sun_uflash.c               |  6 ++----
 drivers/mtd/nand/raw/txx9ndfmc.c            | 15 +++++++++------
 drivers/mtd/spi-nor/controllers/hisi-sfc.c  |  5 ++---
 drivers/mtd/spi-nor/controllers/nxp-spifi.c |  6 ++----
 18 files changed, 44 insertions(+), 71 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
-- 
2.40.1


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

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

end of thread, other threads:[~2023-10-17 13:46 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08 20:01 [PATCH 00/20] mtd: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-08 20:01 ` [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning Uwe Kleine-König
2023-10-09  7:22   ` Masahiro Yamada
2023-10-09  8:43     ` Arnd Bergmann
2023-10-09 10:30       ` Uwe Kleine-König
2023-10-09 12:46         ` Miquel Raynal
2023-10-09 13:01           ` Arnd Bergmann
2023-10-09 13:37             ` Miquel Raynal
2023-10-16  8:57               ` Miquel Raynal
2023-10-16  9:25         ` Arnd Bergmann
2023-10-16 10:21           ` Uwe Kleine-König
2023-10-17 10:20             ` Masahiro Yamada
2023-10-17 13:20               ` Uwe Kleine-König
2023-10-17 13:45                 ` Greg Kroah-Hartman
2023-10-08 20:01 ` [PATCH 02/20] mtd: rawnand: txx9ndfmc: Drop if block with always false condition Uwe Kleine-König
2023-10-08 20:01 ` [PATCH 03/20] mtd: bcm47xxsflash: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 04/20] mtd: docg3: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 05/20] mtd: phram: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 06/20] mtd: powernv_flash: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 07/20] mtd: spear_smi: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 08/20] mtd: st_spi_fsm: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 09/20] mtd: hyperbus: hbmc-am654: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 10/20] mtd: hyperbus: rpc-if: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 11/20] mtd: lpddr2_nvm: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 12/20] mtd: maps: lantiq-flash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 13/20] mtd: maps: physmap-core: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 14/20] mtd: maps: plat-ram: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 15/20] mtd: maps: pxa2xx-flash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 16/20] mtd: maps: sa1100-flash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 17/20] mtd: maps: sun_uflash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 18/20] mtd: rawnand: txx9ndfmc: " Uwe Kleine-König
2023-10-08 20:01 ` [PATCH 19/20] mtd: spi-nor: hisi-sfc: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 20/20] mtd: spi-nor: nxp-spifi: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-09  6:07 ` [PATCH 00/20] mtd: " Tudor Ambarus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox