Message ID | 20220628140313.74984-1-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
Headers | show |
Series | i2c: Make remove callback return void | expand |
On Tue, Jun 28, 2022 at 4:05 PM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > > From: Uwe Kleine-König <uwe@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@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@gmail.com> [...]
Hi Uwe, Looks good - just one minor change for the mctp-i2c driver, but only worthwhile if you end up re-rolling this series for other reasons: > -static int mctp_i2c_remove(struct i2c_client *client) > +static void mctp_i2c_remove(struct i2c_client *client) > { > struct mctp_i2c_client *mcli = i2c_get_clientdata(client); > struct mctp_i2c_dev *midev = NULL, *tmp = NULL; > @@ -1000,7 +1000,6 @@ static int mctp_i2c_remove(struct i2c_client *client) > mctp_i2c_free_client(mcli); > mutex_unlock(&driver_clients_lock); > /* Callers ignore return code */ > - return 0; > } The comment there no longer makes much sense, I'd suggest removing that too. Either way: Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Cheers, Jeremy
Hi Uwe, > diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c > index ef976d085d72..0389223a61f7 100644 > --- a/drivers/media/i2c/st-mipid02.c > +++ b/drivers/media/i2c/st-mipid02.c > @@ -1041,7 +1041,7 @@ static int mipid02_probe(struct i2c_client *client) > return ret; > } > > -static int mipid02_remove(struct i2c_client *client) > +static void mipid02_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); > struct mipid02_dev *bridge = to_mipid02_dev(sd); > @@ -1052,8 +1052,6 @@ static int mipid02_remove(struct i2c_client *client) > mipid02_set_power_off(bridge); > media_entity_cleanup(&bridge->sd.entity); > mutex_destroy(&bridge->lock); > - > - return 0; > } > > static const struct of_device_id mipid02_dt_ids[] = { Thank you. All good for me. Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Cheers, Benjamin