mbox series

[0/3] rpmsg: Convert to platform remove callback returning void

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

Message

Uwe Kleine-König March 21, 2023, 3:40 p.m. UTC
Hello,

this series adapts the platform drivers below drivers/rpmsg 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 two rpmsg platform drivers always returned zero before. This just
wasn't obvious, so the first patch simplifies a bit to make it obvious.
After that the drivers are converted without side effects to
.remove_new().

Best regards
Uwe

Uwe Kleine-König (3):
  rpmsg: qcom_smd: Make qcom_smd_unregister_edge() return void
  rpmsg: qcom_glink_rpm: Convert to platform remove callback returning
    void
  rpmsg: qcom_smd: Convert to platform remove callback returning void

 drivers/rpmsg/qcom_glink_rpm.c |  6 ++----
 drivers/rpmsg/qcom_smd.c       | 24 +++++++++++-------------
 include/linux/rpmsg/qcom_smd.h |  5 ++---
 3 files changed, 15 insertions(+), 20 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Comments

Bjorn Andersson April 6, 2023, 4:04 a.m. UTC | #1
On Tue, 21 Mar 2023 16:40:36 +0100, Uwe Kleine-König wrote:
> this series adapts the platform drivers below drivers/rpmsg 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/3] rpmsg: qcom_smd: Make qcom_smd_unregister_edge() return void
      commit: 810c03d9d7c978b4ee5287d8987043a9be1d614e
[2/3] rpmsg: qcom_glink_rpm: Convert to platform remove callback returning void
      commit: 49446e573bf591eef71c1e8c7cf87ec19aa2569f
[3/3] rpmsg: qcom_smd: Convert to platform remove callback returning void
      commit: 38be89514b88f53ff772d1e016a68b59814aef72

Best regards,