Re: [PATCH v2 4/4] bus: Make remove callback return void

From: Stefan Richter
Date: Wed Jul 07 2021 - 01:57:55 EST


On Jul 06 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.

Acked-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx> (for drivers/firewire)

[...]
> drivers/firewire/core-device.c | 4 +---
[...]
> diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
> index 68216988391f..90ed8fdaba75 100644
> --- a/drivers/firewire/core-device.c
> +++ b/drivers/firewire/core-device.c
> @@ -187,14 +187,12 @@ static int fw_unit_probe(struct device *dev)
> return driver->probe(fw_unit(dev), unit_match(dev, dev->driver));
> }
>
> -static int fw_unit_remove(struct device *dev)
> +static void fw_unit_remove(struct device *dev)
> {
> struct fw_driver *driver =
> container_of(dev->driver, struct fw_driver, driver);
>
> driver->remove(fw_unit(dev));
> -
> - return 0;
> }
>
> static int get_modalias(struct fw_unit *unit, char *buffer, size_t buffer_size)
[...]
--
Stefan Richter
-======--=-= -=== --===
http://arcgraph.de/sr/