mbox series

[0/5] i3c: Convert to platform remove callback returning void

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

Message

Uwe Kleine-König March 18, 2023, 11:33 p.m. UTC
Hello,

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

The first patch simplifies the remove callbacks by making
i3c_master_unregister() return void. After that all drivers are converted
trivially to .remove_new().

Best regards
Uwe

Uwe Kleine-König (5):
  i3c: Make i3c_master_unregister() return void
  i3c: dw: Convert to platform remove callback returning void
  i3c: cdns: Convert to platform remove callback returning void
  i3c: mipi-i3c-hci: Convert to platform remove callback returning void
  i3c: svc: Convert to platform remove callback returning void

 drivers/i3c/master.c                   |  6 +-----
 drivers/i3c/master/dw-i3c-master.c     | 11 +++--------
 drivers/i3c/master/i3c-master-cdns.c   | 11 +++--------
 drivers/i3c/master/mipi-i3c-hci/core.c |  6 +++---
 drivers/i3c/master/svc-i3c-master.c    | 11 +++--------
 include/linux/i3c/master.h             |  2 +-
 6 files changed, 14 insertions(+), 33 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Comments

Alexandre Belloni March 21, 2023, 6:25 p.m. UTC | #1
On Sun, 19 Mar 2023 00:33:06 +0100, Uwe Kleine-König wrote:
> this series adapts the platform drivers below drivers/i3c 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!

[1/5] i3c: Make i3c_master_unregister() return void
      commit: 0f74f8b6675cc36d689abb4d9b3d75ab4049b7d7
[2/5] i3c: dw: Convert to platform remove callback returning void
      commit: 04b5f1be2673a035b0218c6e0369cfd1460d63a1
[3/5] i3c: cdns: Convert to platform remove callback returning void
      commit: 3f8ad583590f7bfeb3b8ee1ddd1cca5f7f9a5a75
[4/5] i3c: mipi-i3c-hci: Convert to platform remove callback returning void
      commit: f959ec617521bab177758b7c71b0d56a65615079
[5/5] i3c: svc: Convert to platform remove callback returning void
      commit: 2810f1de814adb7728b1068586bebcf733cf1992

Best regards,