From ed5c2f5fd10dda07263f79f338a512c0f49f76f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 15 Aug 2022 10:02:30 +0200 Subject: i2c: Make remove callback return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Peter Senna Tschudin Reviewed-by: Jeremy Kerr Reviewed-by: Benjamin Mugnier Reviewed-by: Javier Martinez Canillas Reviewed-by: Crt Mori Reviewed-by: Heikki Krogerus Acked-by: Greg Kroah-Hartman Acked-by: Marek Behún # for leds-turris-omnia Acked-by: Andy Shevchenko Reviewed-by: Petr Machata # for mlxsw Reviewed-by: Maximilian Luz # for surface3_power Acked-by: Srinivas Pandruvada # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil # for media/* + staging/media/* Acked-by: Miguel Ojeda # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli # for versaclock5 Reviewed-by: Ajay Gupta # for ucsi_ccg Acked-by: Jonathan Cameron # for iio Acked-by: Peter Rosin # for i2c-mux-*, max9860 Acked-by: Adrien Grassein # for lontium-lt8912b Reviewed-by: Jean Delvare # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard # for IPMI Reviewed-by: Vladimir Oltean Acked-by: Dmitry Torokhov Acked-by: Sebastian Reichel # for drivers/power Acked-by: Krzysztof Hałasa Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang --- drivers/macintosh/ams/ams-i2c.c | 4 +--- drivers/macintosh/therm_adt746x.c | 4 +--- drivers/macintosh/therm_windtunnel.c | 4 +--- drivers/macintosh/windfarm_ad7417_sensor.c | 4 +--- drivers/macintosh/windfarm_fcu_controls.c | 3 +-- drivers/macintosh/windfarm_lm75_sensor.c | 4 +--- drivers/macintosh/windfarm_lm87_sensor.c | 4 +--- drivers/macintosh/windfarm_max6690_sensor.c | 4 +--- drivers/macintosh/windfarm_smu_sat.c | 4 +--- 9 files changed, 9 insertions(+), 26 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/ams/ams-i2c.c b/drivers/macintosh/ams/ams-i2c.c index d2f0cde6f9c7..362fc56b69dc 100644 --- a/drivers/macintosh/ams/ams-i2c.c +++ b/drivers/macintosh/ams/ams-i2c.c @@ -230,7 +230,7 @@ static int ams_i2c_probe(struct i2c_client *client, return 0; } -static int ams_i2c_remove(struct i2c_client *client) +static void ams_i2c_remove(struct i2c_client *client) { if (ams_info.has_device) { ams_sensor_detach(); @@ -245,8 +245,6 @@ static int ams_i2c_remove(struct i2c_client *client) ams_info.has_device = 0; } - - return 0; } static void ams_i2c_exit(void) diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index e604cbc91763..b004ea2a1102 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -563,7 +563,7 @@ static int probe_thermostat(struct i2c_client *client, return 0; } -static int remove_thermostat(struct i2c_client *client) +static void remove_thermostat(struct i2c_client *client) { struct thermostat *th = i2c_get_clientdata(client); int i; @@ -585,8 +585,6 @@ static int remove_thermostat(struct i2c_client *client) write_both_fan_speed(th, -1); kfree(th); - - return 0; } static const struct i2c_device_id therm_adt746x_id[] = { diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 9226b74fa08f..61fe2ab910b8 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c @@ -334,7 +334,7 @@ static void do_attach(struct i2c_adapter *adapter) } } -static int +static void do_remove(struct i2c_client *client) { if (x.running) { @@ -348,8 +348,6 @@ do_remove(struct i2c_client *client) x.fan = NULL; else printk(KERN_ERR "g4fan: bad client\n"); - - return 0; } static int diff --git a/drivers/macintosh/windfarm_ad7417_sensor.c b/drivers/macintosh/windfarm_ad7417_sensor.c index 6ad6441abcbc..c5c54a4ce91f 100644 --- a/drivers/macintosh/windfarm_ad7417_sensor.c +++ b/drivers/macintosh/windfarm_ad7417_sensor.c @@ -289,7 +289,7 @@ static int wf_ad7417_probe(struct i2c_client *client, return 0; } -static int wf_ad7417_remove(struct i2c_client *client) +static void wf_ad7417_remove(struct i2c_client *client) { struct wf_ad7417_priv *pv = dev_get_drvdata(&client->dev); int i; @@ -302,8 +302,6 @@ static int wf_ad7417_remove(struct i2c_client *client) wf_unregister_sensor(&pv->sensors[i]); kref_put(&pv->ref, wf_ad7417_release); - - return 0; } static const struct i2c_device_id wf_ad7417_id[] = { diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c index 82e7b2005ae7..c5b1ca5bcd73 100644 --- a/drivers/macintosh/windfarm_fcu_controls.c +++ b/drivers/macintosh/windfarm_fcu_controls.c @@ -560,7 +560,7 @@ static int wf_fcu_probe(struct i2c_client *client, return 0; } -static int wf_fcu_remove(struct i2c_client *client) +static void wf_fcu_remove(struct i2c_client *client) { struct wf_fcu_priv *pv = dev_get_drvdata(&client->dev); struct wf_fcu_fan *fan; @@ -571,7 +571,6 @@ static int wf_fcu_remove(struct i2c_client *client) wf_unregister_control(&fan->ctrl); } kref_put(&pv->ref, wf_fcu_release); - return 0; } static const struct i2c_device_id wf_fcu_id[] = { diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index eb7e7f0bd219..204661c8e918 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c @@ -147,7 +147,7 @@ static int wf_lm75_probe(struct i2c_client *client, return rc; } -static int wf_lm75_remove(struct i2c_client *client) +static void wf_lm75_remove(struct i2c_client *client) { struct wf_lm75_sensor *lm = i2c_get_clientdata(client); @@ -156,8 +156,6 @@ static int wf_lm75_remove(struct i2c_client *client) /* release sensor */ wf_unregister_sensor(&lm->sens); - - return 0; } static const struct i2c_device_id wf_lm75_id[] = { diff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c index 807efdde86bc..40d25463346e 100644 --- a/drivers/macintosh/windfarm_lm87_sensor.c +++ b/drivers/macintosh/windfarm_lm87_sensor.c @@ -145,7 +145,7 @@ static int wf_lm87_probe(struct i2c_client *client, return rc; } -static int wf_lm87_remove(struct i2c_client *client) +static void wf_lm87_remove(struct i2c_client *client) { struct wf_lm87_sensor *lm = i2c_get_clientdata(client); @@ -154,8 +154,6 @@ static int wf_lm87_remove(struct i2c_client *client) /* release sensor */ wf_unregister_sensor(&lm->sens); - - return 0; } static const struct i2c_device_id wf_lm87_id[] = { diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index 55ee417fb878..c0d404ebc792 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c @@ -104,14 +104,12 @@ static int wf_max6690_probe(struct i2c_client *client, return rc; } -static int wf_max6690_remove(struct i2c_client *client) +static void wf_max6690_remove(struct i2c_client *client) { struct wf_6690_sensor *max = i2c_get_clientdata(client); max->i2c = NULL; wf_unregister_sensor(&max->sens); - - return 0; } static const struct i2c_device_id wf_max6690_id[] = { diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 5ade627eaa78..be5d4593db93 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -316,7 +316,7 @@ static int wf_sat_probe(struct i2c_client *client, return 0; } -static int wf_sat_remove(struct i2c_client *client) +static void wf_sat_remove(struct i2c_client *client) { struct wf_sat *sat = i2c_get_clientdata(client); struct wf_sat_sensor *sens; @@ -330,8 +330,6 @@ static int wf_sat_remove(struct i2c_client *client) } sat->i2c = NULL; kref_put(&sat->ref, wf_sat_release); - - return 0; } static const struct i2c_device_id wf_sat_id[] = { -- cgit v1.2.3