diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-08-15 10:02:30 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-08-16 12:46:26 +0200 |
commit | ed5c2f5fd10dda07263f79f338a512c0f49f76f5 (patch) | |
tree | bd975d07829fffb0c29e88078d14de787b5e142d /drivers/iio/dac | |
parent | gpio: pca953x: Make platform teardown callback return void (diff) | |
download | linux-ed5c2f5fd10dda07263f79f338a512c0f49f76f5.tar.xz linux-ed5c2f5fd10dda07263f79f338a512c0f49f76f5.zip |
i2c: Make remove callback return void
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 <peter.senna@gmail.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/*
Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5
Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio
Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860
Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b
Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes
Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/iio/dac')
-rw-r--r-- | drivers/iio/dac/ad5380.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/ad5446.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/ad5593r.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/ad5696-i2c.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/ds4424.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/m62332.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/mcp4725.c | 4 | ||||
-rw-r--r-- | drivers/iio/dac/ti-dac5571.c | 4 |
8 files changed, 8 insertions, 24 deletions
diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index 81775152aac6..a81bfa47a221 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c @@ -559,11 +559,9 @@ static int ad5380_i2c_probe(struct i2c_client *i2c, return ad5380_probe(&i2c->dev, regmap, id->driver_data, id->name); } -static int ad5380_i2c_remove(struct i2c_client *i2c) +static void ad5380_i2c_remove(struct i2c_client *i2c) { ad5380_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5380_i2c_ids[] = { diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c index 09e242949cd0..7324065d3782 100644 --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -575,11 +575,9 @@ static int ad5446_i2c_probe(struct i2c_client *i2c, &ad5446_i2c_chip_info[id->driver_data]); } -static int ad5446_i2c_remove(struct i2c_client *i2c) +static void ad5446_i2c_remove(struct i2c_client *i2c) { ad5446_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5446_i2c_ids[] = { diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c index 34e1319a9712..92be661034a6 100644 --- a/drivers/iio/dac/ad5593r.c +++ b/drivers/iio/dac/ad5593r.c @@ -97,11 +97,9 @@ static int ad5593r_i2c_probe(struct i2c_client *i2c, return ad5592r_probe(&i2c->dev, id->name, &ad5593r_rw_ops); } -static int ad5593r_i2c_remove(struct i2c_client *i2c) +static void ad5593r_i2c_remove(struct i2c_client *i2c) { ad5592r_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5593r_i2c_ids[] = { diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c index 762503c1901b..aa36cbf0137c 100644 --- a/drivers/iio/dac/ad5696-i2c.c +++ b/drivers/iio/dac/ad5696-i2c.c @@ -65,11 +65,9 @@ static int ad5686_i2c_probe(struct i2c_client *i2c, ad5686_i2c_write, ad5686_i2c_read); } -static int ad5686_i2c_remove(struct i2c_client *i2c) +static void ad5686_i2c_remove(struct i2c_client *i2c) { ad5686_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5686_i2c_id[] = { diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index 509394690bcc..3e17a681174e 100644 --- a/drivers/iio/dac/ds4424.c +++ b/drivers/iio/dac/ds4424.c @@ -281,15 +281,13 @@ fail: return ret; } -static int ds4424_remove(struct i2c_client *client) +static void ds4424_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ds4424_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); regulator_disable(data->vcc_reg); - - return 0; } static const struct i2c_device_id ds4424_id[] = { diff --git a/drivers/iio/dac/m62332.c b/drivers/iio/dac/m62332.c index 22b02f50fe41..5a812f87970c 100644 --- a/drivers/iio/dac/m62332.c +++ b/drivers/iio/dac/m62332.c @@ -218,7 +218,7 @@ err: return ret; } -static int m62332_remove(struct i2c_client *client) +static void m62332_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -226,8 +226,6 @@ static int m62332_remove(struct i2c_client *client) iio_map_array_unregister(indio_dev); m62332_set_value(indio_dev, 0, 0); m62332_set_value(indio_dev, 0, 1); - - return 0; } static const struct i2c_device_id m62332_id[] = { diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index bb4b85a7b95b..446d1a8fe4be 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c @@ -486,7 +486,7 @@ err_disable_vdd_reg: return err; } -static int mcp4725_remove(struct i2c_client *client) +static void mcp4725_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mcp4725_data *data = iio_priv(indio_dev); @@ -496,8 +496,6 @@ static int mcp4725_remove(struct i2c_client *client) if (data->vref_reg) regulator_disable(data->vref_reg); regulator_disable(data->vdd_reg); - - return 0; } static const struct i2c_device_id mcp4725_id[] = { diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c index f91f8a504989..3210e3098f9a 100644 --- a/drivers/iio/dac/ti-dac5571.c +++ b/drivers/iio/dac/ti-dac5571.c @@ -382,15 +382,13 @@ static int dac5571_probe(struct i2c_client *client, return ret; } -static int dac5571_remove(struct i2c_client *i2c) +static void dac5571_remove(struct i2c_client *i2c) { struct iio_dev *indio_dev = i2c_get_clientdata(i2c); struct dac5571_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); regulator_disable(data->vref); - - return 0; } static const struct of_device_id dac5571_of_id[] = { |