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/rtc | |
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/rtc')
-rw-r--r-- | drivers/rtc/rtc-bq32k.c | 4 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1374.c | 4 | ||||
-rw-r--r-- | drivers/rtc/rtc-isl12026.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 4 | ||||
-rw-r--r-- | drivers/rtc/rtc-rs5c372.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-x1205.c | 3 |
6 files changed, 6 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c index e0bbb11d912e..6d6a55efb9cc 100644 --- a/drivers/rtc/rtc-bq32k.c +++ b/drivers/rtc/rtc-bq32k.c @@ -297,11 +297,9 @@ static int bq32k_probe(struct i2c_client *client) return 0; } -static int bq32k_remove(struct i2c_client *client) +static void bq32k_remove(struct i2c_client *client) { bq32k_sysfs_unregister(&client->dev); - - return 0; } static const struct i2c_device_id bq32k_id[] = { diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index b19de5100b1a..7f089f066163 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c @@ -530,7 +530,7 @@ static int ds1374_probe(struct i2c_client *client) return 0; } -static int ds1374_remove(struct i2c_client *client) +static void ds1374_remove(struct i2c_client *client) { struct ds1374 *ds1374 = i2c_get_clientdata(client); @@ -542,8 +542,6 @@ static int ds1374_remove(struct i2c_client *client) devm_free_irq(&client->dev, client->irq, client); cancel_work_sync(&ds1374->work); } - - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/rtc/rtc-isl12026.c b/drivers/rtc/rtc-isl12026.c index 1fc6627d854d..1bfca39079d4 100644 --- a/drivers/rtc/rtc-isl12026.c +++ b/drivers/rtc/rtc-isl12026.c @@ -472,12 +472,11 @@ static int isl12026_probe_new(struct i2c_client *client) return devm_rtc_register_device(priv->rtc); } -static int isl12026_remove(struct i2c_client *client) +static void isl12026_remove(struct i2c_client *client) { struct isl12026 *priv = i2c_get_clientdata(client); i2c_unregister_device(priv->nvm_client); - return 0; } static const struct of_device_id isl12026_dt_match[] = { diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index d868458cd40e..e0b4d3794320 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -989,7 +989,7 @@ static int m41t80_probe(struct i2c_client *client, return 0; } -static int m41t80_remove(struct i2c_client *client) +static void m41t80_remove(struct i2c_client *client) { #ifdef CONFIG_RTC_DRV_M41T80_WDT struct m41t80_data *clientdata = i2c_get_clientdata(client); @@ -999,8 +999,6 @@ static int m41t80_remove(struct i2c_client *client) unregister_reboot_notifier(&wdt_notifier); } #endif - - return 0; } static struct i2c_driver m41t80_driver = { diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index cb15983383f5..9562c477e1c9 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c @@ -910,10 +910,9 @@ exit: return err; } -static int rs5c372_remove(struct i2c_client *client) +static void rs5c372_remove(struct i2c_client *client) { rs5c_sysfs_unregister(&client->dev); - return 0; } static struct i2c_driver rs5c372_driver = { diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index ba0d22a5b421..f587afa84357 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c @@ -657,10 +657,9 @@ static int x1205_probe(struct i2c_client *client) return 0; } -static int x1205_remove(struct i2c_client *client) +static void x1205_remove(struct i2c_client *client) { x1205_sysfs_unregister(&client->dev); - return 0; } static const struct i2c_device_id x1205_id[] = { |