Re: [PATCH v2 4/4] bus: Make remove callback return void
From: Bjorn Andersson <hidden>
Date: 2021-07-06 18:08:25
Also in:
alsa-devel, dmaengine, kvm, linux-acpi, linux-arm-kernel, linux-arm-msm, linux-cxl, linux-fpga, linux-hyperv, linux-i2c, linux-i3c, linux-input, linux-media, linux-mips, linux-mmc, linux-pci, linux-remoteproc, linux-scsi, linux-serial, linux-spi, linux-staging, linux-sunxi, linux-usb, linux-wireless, linuxppc-dev, nvdimm, platform-driver-x86, target-devel, virtualization, xen-devel
On Tue 06 Jul 10:48 CDT 2021, Uwe Kleine-K?nig wrote:
The driver core ignores the return value of this callback because there
is only little it can do when a device disappears.
This is the final bit of a long lasting cleanup quest where several
buses were converted to also return void from their remove callback.
Additionally some resource leaks were fixed that were caused by drivers
returning an error code in the expectation that the driver won't go
away.
With struct bus_type::remove returning void it's prevented that newly
implemented buses return an ignored error code and so don't anticipate
wrong expectations for driver authors.
Thanks for doing this!
Acked-by: Bjorn Andersson <redacted> (rpmsg and apr)
[..]
quoted hunk ↗ jump to hunk
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index c1404d3dae2c..7f6fac618ab2 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -530,7 +530,7 @@ static int rpmsg_dev_probe(struct device *dev)
return err;
}
-static int rpmsg_dev_remove(struct device *dev)
+static void rpmsg_dev_remove(struct device *dev)
{
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
struct rpmsg_driver *rpdrv = to_rpmsg_driver(rpdev->dev.driver);@@ -546,8 +546,6 @@ static int rpmsg_dev_remove(struct device *dev)
if (rpdev->ept)
rpmsg_destroy_ept(rpdev->ept);
-
- return err;
This leaves err assigned but never used, but I don't mind following up
with a patch cleaning that up after this has landed.
}
static struct bus_type rpmsg_bus = {
Regards,
Bjorn