mbox series

[00/49] mtd: nand: Convert to platform remove callback returning void

Message ID 20230401161938.2503204-1-u.kleine-koenig@pengutronix.de (mailing list archive)
Headers show
Series mtd: nand: Convert to platform remove callback returning void | expand

Message

Uwe Kleine-König April 1, 2023, 4:18 p.m. UTC
Hello,

this series adapts the platform drivers below drivers/mtd/nand 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 a
resource leak.

By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.

As all drivers already return 0 in their .remove callback, they can be
converted trivially.

Thanks
Uwe

Uwe Kleine-König (49):
  mtd: nand: mxic-ecc: Convert to platform remove callback returning
    void
  mtd: onenand: generic: Convert to platform remove callback returning
    void
  mtd: onenand: omap2: Convert to platform remove callback returning
    void
  mtd: onenand: samsung: Convert to platform remove callback returning
    void
  mtd: rawnand: ams-delta: Convert to platform remove callback returning
    void
  mtd: rawnand: arasan: Convert to platform remove callback returning
    void
  mtd: rawnand: atmel: Convert to platform remove callback returning
    void
  mtd: rawnand: au1550nd: Convert to platform remove callback returning
    void
  mtd: rawnand: bcm47xxnflash: Convert to platform remove callback
    returning void
  mtd: rawnand: cadence: Convert to platform remove callback returning
    void
  mtd: rawnand: davinci: Convert to platform remove callback returning
    void
  mtd: rawnand: denali_dt: Convert to platform remove callback returning
    void
  mtd: rawnand: fsl_elbc: Convert to platform remove callback returning
    void
  mtd: rawnand: fsl_ifc: Convert to platform remove callback returning
    void
  mtd: rawnand: fsl_upm: Convert to platform remove callback returning
    void
  mtd: rawnand: fsmc: Convert to platform remove callback returning void
  mtd: rawnand: gpio: Convert to platform remove callback returning void
  mtd: rawnand: gpmi: Convert to platform remove callback returning void
  mtd: rawnand: hisi504: Convert to platform remove callback returning
    void
  mtd: rawnand: ingenic: Convert to platform remove callback returning
    void
  mtd: rawnand: intel: Convert to platform remove callback returning
    void
  mtd: rawnand: lpc32xx_mlc: Convert to platform remove callback
    returning void
  mtd: rawnand: lpc32xx_slc: Convert to platform remove callback
    returning void
  mtd: rawnand: marvell: Convert to platform remove callback returning
    void
  mtd: rawnand: meson: Convert to platform remove callback returning
    void
  mtd: rawnand: mpc5121_nfc: Convert to platform remove callback
    returning void
  mtd: rawnand: mtk: Convert to platform remove callback returning void
  mtd: rawnand: mxc: Convert to platform remove callback returning void
  mtd: rawnand: mxic: Convert to platform remove callback returning void
  mtd: rawnand: ndfc: Convert to platform remove callback returning void
  mtd: rawnand: omap2: Convert to platform remove callback returning
    void
  mtd: rawnand: omap_elm: Convert to platform remove callback returning
    void
  mtd: rawnand: orion: Convert to platform remove callback returning
    void
  mtd: rawnand: oxnas: Convert to platform remove callback returning
    void
  mtd: rawnand: pasemi: Convert to platform remove callback returning
    void
  mtd: rawnand: pl35x: Convert to platform remove callback returning
    void
  mtd: rawnand: plat: Convert to platform remove callback returning void
  mtd: rawnand: qcom: Convert to platform remove callback returning void
  mtd: rawnand: renesas: Convert to platform remove callback returning
    void
  mtd: rawnand: rockchip: Convert to platform remove callback returning
    void
  mtd: rawnand: s3c2410: Convert to platform remove callback returning
    void
  mtd: rawnand: sh_flctl: Convert to platform remove callback returning
    void
  mtd: rawnand: sharpsl: Convert to platform remove callback returning
    void
  mtd: rawnand: socrates: Convert to platform remove callback returning
    void
  mtd: rawnand: stm32_fmc2: Convert to platform remove callback
    returning void
  mtd: rawnand: sunxi: Convert to platform remove callback returning
    void
  mtd: rawnand: tegra: Convert to platform remove callback returning
    void
  mtd: rawnand: vf610_nfc: Convert to platform remove callback returning
    void
  mtd: rawnand: xway: Convert to platform remove callback returning void

 drivers/mtd/nand/ecc-mxic.c                     | 6 ++----
 drivers/mtd/nand/onenand/generic.c              | 6 ++----
 drivers/mtd/nand/onenand/onenand_omap2.c        | 6 ++----
 drivers/mtd/nand/onenand/onenand_samsung.c      | 6 ++----
 drivers/mtd/nand/raw/ams-delta.c                | 6 ++----
 drivers/mtd/nand/raw/arasan-nand-controller.c   | 6 ++----
 drivers/mtd/nand/raw/atmel/nand-controller.c    | 6 ++----
 drivers/mtd/nand/raw/au1550nd.c                 | 5 ++---
 drivers/mtd/nand/raw/bcm47xxnflash/main.c       | 6 ++----
 drivers/mtd/nand/raw/cadence-nand-controller.c  | 6 ++----
 drivers/mtd/nand/raw/davinci_nand.c             | 6 ++----
 drivers/mtd/nand/raw/denali_dt.c                | 6 ++----
 drivers/mtd/nand/raw/fsl_elbc_nand.c            | 6 ++----
 drivers/mtd/nand/raw/fsl_ifc_nand.c             | 6 ++----
 drivers/mtd/nand/raw/fsl_upm.c                  | 6 ++----
 drivers/mtd/nand/raw/fsmc_nand.c                | 6 ++----
 drivers/mtd/nand/raw/gpio.c                     | 6 ++----
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c      | 5 ++---
 drivers/mtd/nand/raw/hisi504_nand.c             | 6 ++----
 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 6 ++----
 drivers/mtd/nand/raw/intel-nand-controller.c    | 6 ++----
 drivers/mtd/nand/raw/lpc32xx_mlc.c              | 6 ++----
 drivers/mtd/nand/raw/lpc32xx_slc.c              | 6 ++----
 drivers/mtd/nand/raw/marvell_nand.c             | 6 ++----
 drivers/mtd/nand/raw/meson_nand.c               | 6 ++----
 drivers/mtd/nand/raw/mpc5121_nfc.c              | 6 ++----
 drivers/mtd/nand/raw/mtk_nand.c                 | 6 ++----
 drivers/mtd/nand/raw/mxc_nand.c                 | 6 ++----
 drivers/mtd/nand/raw/mxic_nand.c                | 5 ++---
 drivers/mtd/nand/raw/ndfc.c                     | 6 ++----
 drivers/mtd/nand/raw/omap2.c                    | 5 ++---
 drivers/mtd/nand/raw/omap_elm.c                 | 5 ++---
 drivers/mtd/nand/raw/orion_nand.c               | 6 ++----
 drivers/mtd/nand/raw/oxnas_nand.c               | 6 ++----
 drivers/mtd/nand/raw/pasemi_nand.c              | 6 ++----
 drivers/mtd/nand/raw/pl35x-nand-controller.c    | 6 ++----
 drivers/mtd/nand/raw/plat_nand.c                | 6 ++----
 drivers/mtd/nand/raw/qcom_nandc.c               | 6 ++----
 drivers/mtd/nand/raw/renesas-nand-controller.c  | 6 ++----
 drivers/mtd/nand/raw/rockchip-nand-controller.c | 6 ++----
 drivers/mtd/nand/raw/s3c2410.c                  | 8 +++-----
 drivers/mtd/nand/raw/sh_flctl.c                 | 6 ++----
 drivers/mtd/nand/raw/sharpsl.c                  | 6 ++----
 drivers/mtd/nand/raw/socrates_nand.c            | 6 ++----
 drivers/mtd/nand/raw/stm32_fmc2_nand.c          | 6 ++----
 drivers/mtd/nand/raw/sunxi_nand.c               | 6 ++----
 drivers/mtd/nand/raw/tegra_nand.c               | 6 ++----
 drivers/mtd/nand/raw/vf610_nfc.c                | 5 ++---
 drivers/mtd/nand/raw/xway_nand.c                | 6 ++----
 49 files changed, 99 insertions(+), 191 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Comments

Tudor Ambarus April 3, 2023, 4:29 p.m. UTC | #1
On 4/1/23 17:18, Uwe Kleine-König wrote:
> Hello,
> 
> this series adapts the platform drivers below drivers/mtd/nand 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 a
> resource leak.
> 
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
> 
> As all drivers already return 0 in their .remove callback, they can be
> converted trivially.
> 

I'd make a single patch per subsystem for trivial changes, but I don't
mind having them split per driver either:

Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Miquel Raynal April 7, 2023, 8:10 a.m. UTC | #2
Hi Uwe,

u.kleine-koenig@pengutronix.de wrote on Sat,  1 Apr 2023 18:18:49 +0200:

> Hello,
> 
> this series adapts the platform drivers below drivers/mtd/nand 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 a
> resource leak.
> 
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
> 
> As all drivers already return 0 in their .remove callback, they can be
> converted trivially.

I've looked at the different patches, they look good to me but as they
are all trivial and exactly identical, would you mind sending this
again all squashed in a single patch? A subsystem-wide conversion seems
appropriate. In all cases I plan to take this for the next merge
window.

I've collected the tags received so far if you want:

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> # atmel
Reviewed-by: Paul Cercueil <paul@crapouillou.net> # ingenic
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> # ingenic
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # intel
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # meson
Acked-by: Roger Quadros <rogerq@kernel.org> # omap
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> # renesas
Reviewed-by: Heiko Stuebner <heiko@sntech.de> # rockchip
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> # sunxi
Acked-by: Thierry Reding <treding@nvidia.com> # tegra

BTW, thanks to all of you who reviewed and answered to this thread!
This is highly appreciated. 

Thanks,
Miquèl