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

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Sat Mar 18 16:33:06 PDT 2023


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
-- 
2.39.2




More information about the linux-i3c mailing list