mbox series

[00/18] mfd: Convert to platform remove callback returning void

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

Message

Uwe Kleine-König Nov. 6, 2023, 5:17 p.m. UTC
Hello,

this series converts all platform drivers below drivers/mfd to use
.remove_new(). 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.

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

All drivers converted here already returned zero unconditionally in
.remove(), so they are converted here trivially.

Best regards
Uwe

Uwe Kleine-König (18):
  mfd: ab8500-sysctrl: Convert to platform remove callback returning
    void
  mfd: cros_ec_dev: Convert to platform remove callback returning void
  mfd: exynos-lpass: Convert to platform remove callback returning void
  mfd: fsl-imx25-tsadc: Convert to platform remove callback returning
    void
  mfd: hi655x-pmic: Convert to platform remove callback returning void
  mfd: intel-lpss-acpi: Convert to platform remove callback returning
    void
  mfd: kempld-core: Convert to platform remove callback returning void
  mfd: mcp-sa11x0: Convert to platform remove callback returning void
  mfd: mxs-lradc: Convert to platform remove callback returning void
  mfd: omap-usb-host: Convert to platform remove callback returning void
  mfd: omap-usb-tll: Convert to platform remove callback returning void
  mfd: pcf50633-adc: Convert to platform remove callback returning void
  mfd: qcom-pm8xxx: Convert to platform remove callback returning void
  mfd: sm501: Convert to platform remove callback returning void
  mfd: stm32-timers: Convert to platform remove callback returning void
  mfd: ti_am335x_tscadc: Convert to platform remove callback returning
    void
  mfd: tps65911-comparator: Convert to platform remove callback
    returning void
  mfd: twl4030-audio: Convert to platform remove callback returning void

 drivers/mfd/ab8500-sysctrl.c      | 6 ++----
 drivers/mfd/cros_ec_dev.c         | 5 ++---
 drivers/mfd/exynos-lpass.c        | 6 ++----
 drivers/mfd/fsl-imx25-tsadc.c     | 6 ++----
 drivers/mfd/hi655x-pmic.c         | 5 ++---
 drivers/mfd/intel-lpss-acpi.c     | 6 ++----
 drivers/mfd/kempld-core.c         | 6 ++----
 drivers/mfd/mcp-sa11x0.c          | 6 ++----
 drivers/mfd/mxs-lradc.c           | 6 ++----
 drivers/mfd/omap-usb-host.c       | 5 ++---
 drivers/mfd/omap-usb-tll.c        | 5 ++---
 drivers/mfd/pcf50633-adc.c        | 6 ++----
 drivers/mfd/qcom-pm8xxx.c         | 6 ++----
 drivers/mfd/sm501.c               | 6 ++----
 drivers/mfd/stm32-timers.c        | 6 ++----
 drivers/mfd/ti_am335x_tscadc.c    | 6 ++----
 drivers/mfd/tps65911-comparator.c | 6 ++----
 drivers/mfd/twl4030-audio.c       | 6 ++----
 18 files changed, 36 insertions(+), 68 deletions(-)

base-commit: 3ff7a5781ceee3befb9224d29cef6e6a4766c5fe

Comments

Lee Jones Nov. 23, 2023, 2:13 p.m. UTC | #1
On Mon, 06 Nov 2023 18:17:09 +0100, Uwe Kleine-König wrote:
> this series converts all platform drivers below drivers/mfd to use
> .remove_new(). 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.
> 
> [...]

Applied, thanks!

[01/18] mfd: ab8500-sysctrl: Convert to platform remove callback returning void
        commit: 35cf346f9fa92ceb19c5d2edc4409a7d384da8ee
[02/18] mfd: cros_ec_dev: Convert to platform remove callback returning void
        commit: 981c92a1d65a7ccce2d814c66ff2deecca304672
[03/18] mfd: exynos-lpass: Convert to platform remove callback returning void
        commit: 2d859aa8e081884c0c02d738925cba23a8cfb1b8
[04/18] mfd: fsl-imx25-tsadc: Convert to platform remove callback returning void
        commit: f215b75acc85254a29404b32c871b7ff2ea8da2a
[09/18] mfd: mxs-lradc: Convert to platform remove callback returning void
        commit: beb1f9e6382f59339e118594c94ee6b5ac96f3ec
[10/18] mfd: omap-usb-host: Convert to platform remove callback returning void
        commit: 231927898ae91049aa35d237c556cc216d80e8f7
[11/18] mfd: omap-usb-tll: Convert to platform remove callback returning void
        commit: 83d4e355240147db7597ea1ce64624fcdaaee6ae
[13/18] mfd: qcom-pm8xxx: Convert to platform remove callback returning void
        commit: ae3bcd5b09e35f363aa1744d38f90fda2b40e9ca
[15/18] mfd: stm32-timers: Convert to platform remove callback returning void
        commit: aeebc47f8d479c363e24fba0201ef8dca417fe6e
[18/18] mfd: twl4030-audio: Convert to platform remove callback returning void
        commit: 3716978b584a8baaba16d64c93eb0fed0edcbc3b

--
Lee Jones [李琼斯]
Lee Jones Nov. 23, 2023, 2:24 p.m. UTC | #2
On Mon, 06 Nov 2023, Uwe Kleine-König wrote:

> Hello,
> 
> this series converts all platform drivers below drivers/mfd to use
> .remove_new(). 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.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> All drivers converted here already returned zero unconditionally in
> .remove(), so they are converted here trivially.
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (18):
>   mfd: ab8500-sysctrl: Convert to platform remove callback returning
>     void
>   mfd: cros_ec_dev: Convert to platform remove callback returning void
>   mfd: exynos-lpass: Convert to platform remove callback returning void
>   mfd: fsl-imx25-tsadc: Convert to platform remove callback returning
>     void
>   mfd: hi655x-pmic: Convert to platform remove callback returning void
>   mfd: intel-lpss-acpi: Convert to platform remove callback returning
>     void
>   mfd: kempld-core: Convert to platform remove callback returning void
>   mfd: mcp-sa11x0: Convert to platform remove callback returning void
>   mfd: mxs-lradc: Convert to platform remove callback returning void
>   mfd: omap-usb-host: Convert to platform remove callback returning void
>   mfd: omap-usb-tll: Convert to platform remove callback returning void
>   mfd: pcf50633-adc: Convert to platform remove callback returning void
>   mfd: qcom-pm8xxx: Convert to platform remove callback returning void
>   mfd: sm501: Convert to platform remove callback returning void
>   mfd: stm32-timers: Convert to platform remove callback returning void
>   mfd: ti_am335x_tscadc: Convert to platform remove callback returning
>     void
>   mfd: tps65911-comparator: Convert to platform remove callback
>     returning void
>   mfd: twl4030-audio: Convert to platform remove callback returning void

Looks like you missed the mailing list on a bunch of these.

I'm going to remove this set for now.

Could you please resubmit it and Cc: LKML?

>  drivers/mfd/ab8500-sysctrl.c      | 6 ++----
>  drivers/mfd/cros_ec_dev.c         | 5 ++---
>  drivers/mfd/exynos-lpass.c        | 6 ++----
>  drivers/mfd/fsl-imx25-tsadc.c     | 6 ++----
>  drivers/mfd/hi655x-pmic.c         | 5 ++---
>  drivers/mfd/intel-lpss-acpi.c     | 6 ++----
>  drivers/mfd/kempld-core.c         | 6 ++----
>  drivers/mfd/mcp-sa11x0.c          | 6 ++----
>  drivers/mfd/mxs-lradc.c           | 6 ++----
>  drivers/mfd/omap-usb-host.c       | 5 ++---
>  drivers/mfd/omap-usb-tll.c        | 5 ++---
>  drivers/mfd/pcf50633-adc.c        | 6 ++----
>  drivers/mfd/qcom-pm8xxx.c         | 6 ++----
>  drivers/mfd/sm501.c               | 6 ++----
>  drivers/mfd/stm32-timers.c        | 6 ++----
>  drivers/mfd/ti_am335x_tscadc.c    | 6 ++----
>  drivers/mfd/tps65911-comparator.c | 6 ++----
>  drivers/mfd/twl4030-audio.c       | 6 ++----
>  18 files changed, 36 insertions(+), 68 deletions(-)
> 
> base-commit: 3ff7a5781ceee3befb9224d29cef6e6a4766c5fe
> -- 
> 2.42.0
>