[PATCH 00/30] pwm: Convert to platform remove callback returning void

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Mar 3 10:54:15 PST 2023


Hello,

this patch series adapts the platform drivers below drivers/pwm 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.

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

Note that this series depends on commit 5c5a7680e67b ("platform: Provide
a remove callback that returns no value") that is already in Linus' tree
but not yet included in a tagged version.

Best regards
Uwe

Uwe Kleine-König (30):
  pwm: atmel-hlcdc: Convert to platform remove callback returning void
  pwm: atmel-tcb: Convert to platform remove callback returning void
  pwm: atmel: Convert to platform remove callback returning void
  pwm: bcm-iproc: Convert to platform remove callback returning void
  pwm: bcm2835: Convert to platform remove callback returning void
  pwm: berlin: Convert to platform remove callback returning void
  pwm: brcmstb: Convert to platform remove callback returning void
  pwm: clk: Convert to platform remove callback returning void
  pwm: cros-ec: Convert to platform remove callback returning void
  pwm: hibvt: Convert to platform remove callback returning void
  pwm: img: Convert to platform remove callback returning void
  pwm: imx-tpm: Convert to platform remove callback returning void
  pwm: lpc18xx-sct: Convert to platform remove callback returning void
  pwm: lpss-platform: Convert to platform remove callback returning void
  pwm: mtk-disp: Convert to platform remove callback returning void
  pwm: omap-dmtimer: Convert to platform remove callback returning void
  pwm: rcar: Convert to platform remove callback returning void
  pwm: rockchip: Convert to platform remove callback returning void
  pwm: samsung: Convert to platform remove callback returning void
  pwm: sifive: Convert to platform remove callback returning void
  pwm: spear: Convert to platform remove callback returning void
  pwm: sprd: Convert to platform remove callback returning void
  pwm: sti: Convert to platform remove callback returning void
  pwm: stm32: Convert to platform remove callback returning void
  pwm: sun4i: Convert to platform remove callback returning void
  pwm: tegra: Convert to platform remove callback returning void
  pwm: tiecap: Convert to platform remove callback returning void
  pwm: tiehrpwm: Convert to platform remove callback returning void
  pwm: vt8500: Convert to platform remove callback returning void
  pwm: xilinx: Convert to platform remove callback returning void

 drivers/pwm/pwm-atmel-hlcdc.c   | 6 ++----
 drivers/pwm/pwm-atmel-tcb.c     | 6 ++----
 drivers/pwm/pwm-atmel.c         | 6 ++----
 drivers/pwm/pwm-bcm-iproc.c     | 6 ++----
 drivers/pwm/pwm-bcm2835.c       | 6 ++----
 drivers/pwm/pwm-berlin.c        | 6 ++----
 drivers/pwm/pwm-brcmstb.c       | 6 ++----
 drivers/pwm/pwm-clk.c           | 6 ++----
 drivers/pwm/pwm-cros-ec.c       | 6 ++----
 drivers/pwm/pwm-hibvt.c         | 6 ++----
 drivers/pwm/pwm-img.c           | 6 ++----
 drivers/pwm/pwm-imx-tpm.c       | 6 ++----
 drivers/pwm/pwm-lpc18xx-sct.c   | 6 ++----
 drivers/pwm/pwm-lpss-platform.c | 5 ++---
 drivers/pwm/pwm-mtk-disp.c      | 6 ++----
 drivers/pwm/pwm-omap-dmtimer.c  | 6 ++----
 drivers/pwm/pwm-rcar.c          | 6 ++----
 drivers/pwm/pwm-rockchip.c      | 6 ++----
 drivers/pwm/pwm-samsung.c       | 6 ++----
 drivers/pwm/pwm-sifive.c        | 6 ++----
 drivers/pwm/pwm-spear.c         | 6 ++----
 drivers/pwm/pwm-sprd.c          | 6 ++----
 drivers/pwm/pwm-sti.c           | 6 ++----
 drivers/pwm/pwm-stm32.c         | 6 ++----
 drivers/pwm/pwm-sun4i.c         | 6 ++----
 drivers/pwm/pwm-tegra.c         | 6 ++----
 drivers/pwm/pwm-tiecap.c        | 6 ++----
 drivers/pwm/pwm-tiehrpwm.c      | 6 ++----
 drivers/pwm/pwm-vt8500.c        | 6 ++----
 drivers/pwm/pwm-xilinx.c        | 5 ++---
 30 files changed, 60 insertions(+), 118 deletions(-)

base-commit: 2eb29d59ddf02e39774abfb60b2030b0b7e27c1f
-- 
2.39.1




More information about the linux-arm-kernel mailing list