Re: [PATCH v4 5/5] bus: Make remove callback return void

From: Sudeep Holla
Date: Wed Jul 14 2021 - 06:27:07 EST


On Tue, Jul 13, 2021 at 09:35:22PM +0200, 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.
>

[...]

> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index 784cf0027da3..2682c3df651c 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -116,15 +116,13 @@ static int scmi_dev_probe(struct device *dev)
> return scmi_drv->probe(scmi_dev);
> }
>
> -static int scmi_dev_remove(struct device *dev)
> +static void scmi_dev_remove(struct device *dev)
> {
> struct scmi_driver *scmi_drv = to_scmi_driver(dev->driver);
> struct scmi_device *scmi_dev = to_scmi_dev(dev);
>
> if (scmi_drv->remove)
> scmi_drv->remove(scmi_dev);
> -
> - return 0;
> }
>
> static struct bus_type scmi_bus_type = {

Acked-by: Sudeep Holla <sudeep.holla@xxxxxxx>

--
Regards,
Sudeep