[PATCH 5/5] spi: make remove callback a void function

Jérôme Pouiller jerome.pouiller at silabs.com
Tue Jan 25 14:16:33 UTC 2022


On Sunday 23 January 2022 18:52:01 CET Uwe Kleine-König wrote:
> 
> The value returned by an spi driver's remove function is mostly ignored.
> (Only an error message is printed if the value is non-zero that the
> error is ignored.)
> 
> So change the prototype of the remove function to return no value. This
> way driver authors are not tempted to assume that passing an error to
> the upper layer is a good idea. All drivers are adapted accordingly.
> There is no intended change of behaviour, all callbacks were prepared to
> return 0 before.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

[...]
> diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
> index 55ffcd7c42e2..fa0ff66a457d 100644
> --- a/drivers/staging/wfx/bus_spi.c
> +++ b/drivers/staging/wfx/bus_spi.c
> @@ -232,12 +232,11 @@ static int wfx_spi_probe(struct spi_device *func)
>         return wfx_probe(bus->core);
>  }
> 
> -static int wfx_spi_remove(struct spi_device *func)
> +static void wfx_spi_remove(struct spi_device *func)
>  {
>         struct wfx_spi_priv *bus = spi_get_drvdata(func);
> 
>         wfx_release(bus->core);
> -       return 0;
>  }
> 
>  /* For dynamic driver binding, kernel does not use OF to match driver. It only

For the wfx driver: 

Acked-by: Jérôme Pouiller <jerome.pouiller at silabs.com>

-- 
Jérôme Pouiller




More information about the dri-devel mailing list