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/video | |
parent | 6a8f359c3132e4f51bdb263ad74ec632c65e55fd (diff) |
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/video')
-rw-r--r-- | drivers/video/backlight/adp8860_bl.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/adp8870_bl.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/arcxcnn_bl.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/bd6107.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/lm3630a_bl.c | 3 | ||||
-rw-r--r-- | drivers/video/backlight/lm3639_bl.c | 3 | ||||
-rw-r--r-- | drivers/video/backlight/lp855x_bl.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/lv5207lp.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/tosa_bl.c | 3 | ||||
-rw-r--r-- | drivers/video/fbdev/matrox/matroxfb_maven.c | 3 | ||||
-rw-r--r-- | drivers/video/fbdev/ssd1307fb.c | 4 |
11 files changed, 11 insertions, 29 deletions
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 8ec19425671f..b0fe02273e87 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c @@ -753,7 +753,7 @@ out: return ret; } -static int adp8860_remove(struct i2c_client *client) +static void adp8860_remove(struct i2c_client *client) { struct adp8860_bl *data = i2c_get_clientdata(client); @@ -765,8 +765,6 @@ static int adp8860_remove(struct i2c_client *client) if (data->en_ambl_sens) sysfs_remove_group(&data->bl->dev.kobj, &adp8860_bl_attr_group); - - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 8b5213a39527..5becace3fd0f 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c @@ -925,7 +925,7 @@ out: return ret; } -static int adp8870_remove(struct i2c_client *client) +static void adp8870_remove(struct i2c_client *client) { struct adp8870_bl *data = i2c_get_clientdata(client); @@ -937,8 +937,6 @@ static int adp8870_remove(struct i2c_client *client) if (data->pdata->en_ambl_sens) sysfs_remove_group(&data->bl->dev.kobj, &adp8870_bl_attr_group); - - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/video/backlight/arcxcnn_bl.c b/drivers/video/backlight/arcxcnn_bl.c index 7b1c0a0e6cad..060c0eef6a52 100644 --- a/drivers/video/backlight/arcxcnn_bl.c +++ b/drivers/video/backlight/arcxcnn_bl.c @@ -362,7 +362,7 @@ probe_err: return ret; } -static int arcxcnn_remove(struct i2c_client *cl) +static void arcxcnn_remove(struct i2c_client *cl) { struct arcxcnn *lp = i2c_get_clientdata(cl); @@ -376,8 +376,6 @@ static int arcxcnn_remove(struct i2c_client *cl) lp->bl->props.brightness = 0; backlight_update_status(lp->bl); - - return 0; } static const struct of_device_id arcxcnn_dt_ids[] = { diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index 515184fbe33a..a506872d4396 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -175,14 +175,12 @@ static int bd6107_probe(struct i2c_client *client, return 0; } -static int bd6107_remove(struct i2c_client *client) +static void bd6107_remove(struct i2c_client *client) { struct backlight_device *backlight = i2c_get_clientdata(client); backlight->props.brightness = 0; backlight_update_status(backlight); - - return 0; } static const struct i2c_device_id bd6107_ids[] = { diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 1d17c439430e..475f35635bf6 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -579,7 +579,7 @@ static int lm3630a_probe(struct i2c_client *client, return 0; } -static int lm3630a_remove(struct i2c_client *client) +static void lm3630a_remove(struct i2c_client *client) { int rval; struct lm3630a_chip *pchip = i2c_get_clientdata(client); @@ -596,7 +596,6 @@ static int lm3630a_remove(struct i2c_client *client) free_irq(pchip->irq, pchip); destroy_workqueue(pchip->irqthread); } - return 0; } static const struct i2c_device_id lm3630a_id[] = { diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 48c04155a5f9..6580911671a3 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -390,7 +390,7 @@ err_out: return ret; } -static int lm3639_remove(struct i2c_client *client) +static void lm3639_remove(struct i2c_client *client) { struct lm3639_chip_data *pchip = i2c_get_clientdata(client); @@ -400,7 +400,6 @@ static int lm3639_remove(struct i2c_client *client) led_classdev_unregister(&pchip->cdev_flash); if (pchip->bled) device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode); - return 0; } static const struct i2c_device_id lm3639_id[] = { diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index fc02c5c16055..bd0bdeae23a4 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -534,7 +534,7 @@ disable_supply: return ret; } -static int lp855x_remove(struct i2c_client *cl) +static void lp855x_remove(struct i2c_client *cl) { struct lp855x *lp = i2c_get_clientdata(cl); @@ -545,8 +545,6 @@ static int lp855x_remove(struct i2c_client *cl) if (lp->supply) regulator_disable(lp->supply); sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group); - - return 0; } static const struct of_device_id lp855x_dt_ids[] = { diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 1842ae9a55f8..767b800d79fa 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c @@ -124,14 +124,12 @@ static int lv5207lp_probe(struct i2c_client *client, return 0; } -static int lv5207lp_remove(struct i2c_client *client) +static void lv5207lp_remove(struct i2c_client *client) { struct backlight_device *backlight = i2c_get_clientdata(client); backlight->props.brightness = 0; backlight_update_status(backlight); - - return 0; } static const struct i2c_device_id lv5207lp_ids[] = { diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 6df6fcd132e3..f55b3d616a87 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c @@ -121,12 +121,11 @@ err_reg: return ret; } -static int tosa_bl_remove(struct i2c_client *client) +static void tosa_bl_remove(struct i2c_client *client) { struct tosa_bl_data *data = i2c_get_clientdata(client); data->bl = NULL; - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/video/fbdev/matrox/matroxfb_maven.c b/drivers/video/fbdev/matrox/matroxfb_maven.c index 9a98c4a6ba33..f2e02958673d 100644 --- a/drivers/video/fbdev/matrox/matroxfb_maven.c +++ b/drivers/video/fbdev/matrox/matroxfb_maven.c @@ -1276,11 +1276,10 @@ ERROR0:; return err; } -static int maven_remove(struct i2c_client *client) +static void maven_remove(struct i2c_client *client) { maven_shutdown_client(client); kfree(i2c_get_clientdata(client)); - return 0; } static const struct i2c_device_id maven_id[] = { diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 5c765655d000..fbf26cdfb1c0 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -817,7 +817,7 @@ fb_alloc_error: return ret; } -static int ssd1307fb_remove(struct i2c_client *client) +static void ssd1307fb_remove(struct i2c_client *client) { struct fb_info *info = i2c_get_clientdata(client); struct ssd1307fb_par *par = info->par; @@ -836,8 +836,6 @@ static int ssd1307fb_remove(struct i2c_client *client) fb_deferred_io_cleanup(info); __free_pages(__va(info->fix.smem_start), get_order(info->fix.smem_len)); framebuffer_release(info); - - return 0; } static const struct i2c_device_id ssd1307fb_i2c_id[] = { |