[PATCH 6/6] i2c: Make remove callback return void

Peter Senna Tschudin peter.senna at gmail.com
Wed Jun 29 16:56:55 AEST 2022


On Tue, Jun 28, 2022 at 4:05 PM Uwe Kleine-König
<u.kleine-koenig at pengutronix.de> wrote:
>
> From: Uwe Kleine-König <uwe at kleine-koenig.org>
>
> The value returned by an i2c 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>
> ---

[...]

>  static struct i2c_device_id lt9611uxc_id[] = {
> diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> index cce98bf2a4e7..9f175df11581 100644
> --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> @@ -355,11 +355,9 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
>         return ge_b850v3_register();
>  }
>
> -static int stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
> +static void stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
>  {
>         ge_b850v3_lvds_remove();
> -
> -       return 0;
>  }
>
>  static const struct i2c_device_id stdp4028_ge_b850v3_fw_i2c_table[] = {
> @@ -405,11 +403,9 @@ static int stdp2690_ge_b850v3_fw_probe(struct i2c_client *stdp2690_i2c,
>         return ge_b850v3_register();
>  }
>
> -static int stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)
> +static void stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)
>  {
>         ge_b850v3_lvds_remove();
> -
> -       return 0;
>  }
>
>  static const struct i2c_device_id stdp2690_ge_b850v3_fw_i2c_table[] = {
Reviewed-by: Peter Senna Tschudin <peter.senna at gmail.com>

[...]


More information about the Linuxppc-dev mailing list