mbox series

[00/41] rtc: Convert to platform remove callback returning void

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

Message

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

this patch series adapts the platform drivers below drivers/rtc 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. I guess this will change tomorrow.

Best regards
Uwe

Uwe Kleine-König (41):
  rtc: 88pm80x: Convert to platform remove callback returning void
  rtc: 88pm860x: Convert to platform remove callback returning void
  rtc: ab8500: Convert to platform remove callback returning void
  rtc: ac100: Convert to platform remove callback returning void
  rtc: asm9260: Convert to platform remove callback returning void
  rtc: at91sam9: Convert to platform remove callback returning void
  rtc: brcmstb-waketimer: Convert to platform remove callback returning void
  rtc: cadence: Convert to platform remove callback returning void
  rtc: cmos: Convert to platform remove callback returning void
  rtc: cros-ec: Convert to platform remove callback returning void
  rtc: ds1685: Convert to platform remove callback returning void
  rtc: ftrtc010: Convert to platform remove callback returning void
  rtc: hid-sensor-time: Convert to platform remove callback returning void
  rtc: lpc24xx: Convert to platform remove callback returning void
  rtc: max77686: Convert to platform remove callback returning void
  rtc: mc13xxx: Convert to platform remove callback returning void
  rtc: mpc5121: Convert to platform remove callback returning void
  rtc: mpfs: Convert to platform remove callback returning void
  rtc: mt7622: Convert to platform remove callback returning void
  rtc: mxc_v2: Convert to platform remove callback returning void
  rtc: omap: Convert to platform remove callback returning void
  rtc: palmas: Convert to platform remove callback returning void
  rtc: pcf50633: Convert to platform remove callback returning void
  rtc: pic32: Convert to platform remove callback returning void
  rtc: pm8xxx: Convert to platform remove callback returning void
  rtc: rc5t583: Convert to platform remove callback returning void
  rtc: rtd119x: Convert to platform remove callback returning void
  rtc: rzn1: Convert to platform remove callback returning void
  rtc: s3c: Convert to platform remove callback returning void
  rtc: sa1100: Convert to platform remove callback returning void
  rtc: spear: Convert to platform remove callback returning void
  rtc: stm32: Convert to platform remove callback returning void
  rtc: stmp3xxx: Convert to platform remove callback returning void
  rtc: sunplus: Convert to platform remove callback returning void
  rtc: tegra: Convert to platform remove callback returning void
  rtc: tps6586x: Convert to platform remove callback returning void
  rtc: twl: Convert to platform remove callback returning void
  rtc: vt8500: Convert to platform remove callback returning void
  rtc: wm8350: Convert to platform remove callback returning void
  rtc: xgene: Convert to platform remove callback returning void
  rtc: zynqmp: Convert to platform remove callback returning void

 drivers/rtc/rtc-88pm80x.c           | 5 ++---
 drivers/rtc/rtc-88pm860x.c          | 6 ++----
 drivers/rtc/rtc-ab8500.c            | 6 ++----
 drivers/rtc/rtc-ac100.c             | 6 ++----
 drivers/rtc/rtc-asm9260.c           | 5 ++---
 drivers/rtc/rtc-at91sam9.c          | 6 ++----
 drivers/rtc/rtc-brcmstb-waketimer.c | 6 ++----
 drivers/rtc/rtc-cadence.c           | 6 ++----
 drivers/rtc/rtc-cmos.c              | 5 ++---
 drivers/rtc/rtc-cros-ec.c           | 6 ++----
 drivers/rtc/rtc-ds1685.c            | 6 ++----
 drivers/rtc/rtc-ftrtc010.c          | 6 ++----
 drivers/rtc/rtc-hid-sensor-time.c   | 6 ++----
 drivers/rtc/rtc-lpc24xx.c           | 6 ++----
 drivers/rtc/rtc-max77686.c          | 6 ++----
 drivers/rtc/rtc-mc13xxx.c           | 6 ++----
 drivers/rtc/rtc-mpc5121.c           | 6 ++----
 drivers/rtc/rtc-mpfs.c              | 6 ++----
 drivers/rtc/rtc-mt7622.c            | 6 ++----
 drivers/rtc/rtc-mxc_v2.c            | 5 ++---
 drivers/rtc/rtc-omap.c              | 6 ++----
 drivers/rtc/rtc-palmas.c            | 5 ++---
 drivers/rtc/rtc-pcf50633.c          | 6 ++----
 drivers/rtc/rtc-pic32.c             | 6 ++----
 drivers/rtc/rtc-pm8xxx.c            | 5 ++---
 drivers/rtc/rtc-rc5t583.c           | 5 ++---
 drivers/rtc/rtc-rtd119x.c           | 6 ++----
 drivers/rtc/rtc-rzn1.c              | 6 ++----
 drivers/rtc/rtc-s3c.c               | 6 ++----
 drivers/rtc/rtc-sa1100.c            | 6 ++----
 drivers/rtc/rtc-spear.c             | 6 ++----
 drivers/rtc/rtc-stm32.c             | 6 ++----
 drivers/rtc/rtc-stmp3xxx.c          | 8 +++-----
 drivers/rtc/rtc-sunplus.c           | 6 ++----
 drivers/rtc/rtc-tegra.c             | 6 ++----
 drivers/rtc/rtc-tps6586x.c          | 5 ++---
 drivers/rtc/rtc-twl.c               | 6 ++----
 drivers/rtc/rtc-vt8500.c            | 6 ++----
 drivers/rtc/rtc-wm8350.c            | 6 ++----
 drivers/rtc/rtc-xgene.c             | 5 ++---
 drivers/rtc/rtc-zynqmp.c            | 6 ++----
 41 files changed, 83 insertions(+), 156 deletions(-)

base-commit: 0988a0ea791999ebbf95693f2676381825b05033

Comments

Naresh Kamboju March 14, 2023, 9:05 a.m. UTC | #1
> Hello,
> 
> this patch series adapts the platform drivers below drivers/rtc 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.

This patch set applied on top of Linux next.

Build tested with gcc-12, clang-16 and clang nightly.
Boot and LTP smoketests performed on
 - qemu-x86_64
 - qemu-arm64
 - fvp-aemva
 - qemu-armv7
 - qemu-i386

Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>

Link,
https://qa-reports.linaro.org/~anders.roxell/linux-mainline-patches/build/lore_kernel_org_linux-arm-kernel_20230304133028_2135435-1-u_kleine-koenig_pengutronix_de/?failures_only=false#!#test-results

--
Linaro LKFT
https://lkft.linaro.org
Alexandre Belloni March 17, 2023, 10:09 p.m. UTC | #2
On Sat, 04 Mar 2023 14:29:47 +0100, Uwe Kleine-König wrote:
> this patch series adapts the platform drivers below drivers/rtc 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.
> 
> [...]

Applied, thanks!

[01/41] rtc: 88pm80x: Convert to platform remove callback returning void
        commit: 8ef70a5ef3ed41ce4d700794d45fd9e084460a00
[02/41] rtc: 88pm860x: Convert to platform remove callback returning void
        commit: 8fbff75e2b7582fc03dbcd13e67831fb75345dcb
[03/41] rtc: ab8500: Convert to platform remove callback returning void
        commit: 8a700af1babfc0e5d34bd95264d65ea6adb0b288
[04/41] rtc: ac100: Convert to platform remove callback returning void
        commit: 28015e799ad9ff04d68107b7392a4884accedb0e
[05/41] rtc: asm9260: Convert to platform remove callback returning void
        commit: ad01bf83bfc33c53079415f02e160bf72221d7e6
[06/41] rtc: at91sam9: Convert to platform remove callback returning void
        commit: 06e5e4a5a996aefb5d8e0c8db05b014e3bd91a28
[07/41] rtc: brcmstb-waketimer: Convert to platform remove callback returning void
        commit: d64906b320ce6fef446ea72c6043bbec19f0da60
[08/41] rtc: cadence: Convert to platform remove callback returning void
        commit: 0b9efd82a63b31c7c2ce17a3d8ad3aeb28b3a928
[09/41] rtc: cmos: Convert to platform remove callback returning void
        commit: 63c18a079bbb5f564b30e0fa7ec292eb123b1bf6
[10/41] rtc: cros-ec: Convert to platform remove callback returning void
        commit: 0d8742e61098b422b1ba1458a7ce80c4f1e299bb
[11/41] rtc: ds1685: Convert to platform remove callback returning void
        commit: de11783c9d2a4dec9e0e2c01b9a9897d72019d5f
[12/41] rtc: ftrtc010: Convert to platform remove callback returning void
        commit: 43eeb707afb00579a7bb611d14fc9a056bba849e
[13/41] rtc: hid-sensor-time: Convert to platform remove callback returning void
        commit: 30d5365c8dda63e31fb1fbbec446d72d0f1e5ce6
[14/41] rtc: lpc24xx: Convert to platform remove callback returning void
        commit: 52fcb90d8cdf117ade871b01861b8a8defbf3b78
[15/41] rtc: max77686: Convert to platform remove callback returning void
        commit: bf05de01160d493d53cc289be1b1092c26b378b4
[16/41] rtc: mc13xxx: Convert to platform remove callback returning void
        commit: 99c3a1367db02b6b57be54bf61da051a93e0615f
[17/41] rtc: mpc5121: Convert to platform remove callback returning void
        commit: 22edbc10a514a8cf56d9c8da5cc1a2d43e6832a5
[18/41] rtc: mpfs: Convert to platform remove callback returning void
        commit: fa147083acf61de306e2881d91401d817de11093
[19/41] rtc: mt7622: Convert to platform remove callback returning void
        commit: ae0ac71651c726c2f1d5af752d38bf40526b7026
[20/41] rtc: mxc_v2: Convert to platform remove callback returning void
        commit: 153f56f9ce99495ca4cb6d7f2047c29940aef9f5
[21/41] rtc: omap: Convert to platform remove callback returning void
        commit: 578afdb9084ed0446060d627e7f3ecd1c4100c3d
[22/41] rtc: palmas: Convert to platform remove callback returning void
        commit: a7f9864e4362e07e113517d647c5bc355cdee970
[23/41] rtc: pcf50633: Convert to platform remove callback returning void
        commit: d25f0ba97692b4a8ac63bbd2c562741525c5f5ca
[24/41] rtc: pic32: Convert to platform remove callback returning void
        commit: c3d12a10922dcf32a97d3c71f6a574529b061caf
[25/41] rtc: pm8xxx: Convert to platform remove callback returning void
        commit: 3fc5029a8f7d0d3c039c3649e82cc2e4eeeb46a6
[26/41] rtc: rc5t583: Convert to platform remove callback returning void
        commit: ade527dd2192ddabbd4926338c31ca281098c34c
[27/41] rtc: rtd119x: Convert to platform remove callback returning void
        commit: 0824a15b6863a19c7c8e1c16abf6090fd8ac615f
[28/41] rtc: rzn1: Convert to platform remove callback returning void
        commit: e55fbc80e9d2bf3ec0ec77551baa683f30e85b74
[29/41] rtc: s3c: Convert to platform remove callback returning void
        commit: 9e6a2ad120fa3f785f013e70ae7d872abafb8318
[30/41] rtc: sa1100: Convert to platform remove callback returning void
        commit: cf407e9f1a9dc290e2088c11bd0e5542334e7ab4
[31/41] rtc: spear: Convert to platform remove callback returning void
        commit: 25ffc856b3cb1bd08a8645839aa38505469a6edd
[32/41] rtc: stm32: Convert to platform remove callback returning void
        commit: 54c2cb2797cd76465dae08cd9b81676ffad36b27
[33/41] rtc: stmp3xxx: Convert to platform remove callback returning void
        commit: 16324165ab1f90fa06294679e3de58cb53c0423f
[34/41] rtc: sunplus: Convert to platform remove callback returning void
        commit: d6f525040eef1562327fccc4412acdb4f173e01b
[35/41] rtc: tegra: Convert to platform remove callback returning void
        commit: 31c94505f44b47493d62c0fd43d30838326d345f
[36/41] rtc: tps6586x: Convert to platform remove callback returning void
        commit: adebcc1c1916188c1c9ac8e8f54123b07431baf7
[37/41] rtc: twl: Convert to platform remove callback returning void
        commit: fff118c9e8331b9b08b69841498fbea34693a28c
[38/41] rtc: vt8500: Convert to platform remove callback returning void
        commit: 5b1064441f20fc3f397239599b1193fecb7a90e4
[39/41] rtc: wm8350: Convert to platform remove callback returning void
        commit: 631aa2d919f542373892d5ef6baf13e2969a10fd
[40/41] rtc: xgene: Convert to platform remove callback returning void
        commit: 257062d2679f4db5b6ebc9f4e6a77d0a45977278
[41/41] rtc: zynqmp: Convert to platform remove callback returning void
        commit: f45e5cfa73f445fa3cfbb7ebac3a7e2c66a9281c

Best regards,
patchwork-bot+chrome-platform@kernel.org May 8, 2023, 3:45 a.m. UTC | #3
Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Alexandre Belloni <alexandre.belloni@bootlin.com>:

On Sat,  4 Mar 2023 14:29:47 +0100 you wrote:
> Hello,
> 
> this patch series adapts the platform drivers below drivers/rtc 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.
> 
> [...]

Here is the summary with links:
  - [10/41] rtc: cros-ec: Convert to platform remove callback returning void
    https://git.kernel.org/chrome-platform/c/0d8742e61098

You are awesome, thank you!
patchwork-bot+chrome-platform@kernel.org May 8, 2023, 3:56 a.m. UTC | #4
Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Alexandre Belloni <alexandre.belloni@bootlin.com>:

On Sat,  4 Mar 2023 14:29:47 +0100 you wrote:
> Hello,
> 
> this patch series adapts the platform drivers below drivers/rtc 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.
> 
> [...]

Here is the summary with links:
  - [10/41] rtc: cros-ec: Convert to platform remove callback returning void
    https://git.kernel.org/chrome-platform/c/0d8742e61098

You are awesome, thank you!