diff options
author | Uwe Kleine-König | 2022-08-15 10:02:30 +0200 |
---|---|---|
committer | Wolfram Sang | 2022-08-16 12:46:26 +0200 |
commit | ed5c2f5fd10dda07263f79f338a512c0f49f76f5 (patch) | |
tree | bd975d07829fffb0c29e88078d14de787b5e142d /drivers/char | |
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/char')
-rw-r--r-- | drivers/char/ipmi/ipmb_dev_int.c | 4 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_ipmb.c | 4 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_ssif.c | 6 | ||||
-rw-r--r-- | drivers/char/tpm/st33zp24/i2c.c | 4 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_i2c_atmel.c | 3 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_i2c_infineon.c | 4 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_i2c_nuvoton.c | 3 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis_i2c.c | 3 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis_i2c_cr50.c | 6 |
9 files changed, 11 insertions, 26 deletions
diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c index db40037eb347..a0e9e80d92ee 100644 --- a/drivers/char/ipmi/ipmb_dev_int.c +++ b/drivers/char/ipmi/ipmb_dev_int.c @@ -341,14 +341,12 @@ static int ipmb_probe(struct i2c_client *client) return 0; } -static int ipmb_remove(struct i2c_client *client) +static void ipmb_remove(struct i2c_client *client) { struct ipmb_dev *ipmb_dev = i2c_get_clientdata(client); i2c_slave_unregister(client); misc_deregister(&ipmb_dev->miscdev); - - return 0; } static const struct i2c_device_id ipmb_id[] = { diff --git a/drivers/char/ipmi/ipmi_ipmb.c b/drivers/char/ipmi/ipmi_ipmb.c index ab19b4b3317e..25c010c9ec25 100644 --- a/drivers/char/ipmi/ipmi_ipmb.c +++ b/drivers/char/ipmi/ipmi_ipmb.c @@ -424,7 +424,7 @@ static void ipmi_ipmb_request_events(void *send_info) /* We don't fetch events here. */ } -static int ipmi_ipmb_remove(struct i2c_client *client) +static void ipmi_ipmb_remove(struct i2c_client *client) { struct ipmi_ipmb_dev *iidev = i2c_get_clientdata(client); @@ -438,8 +438,6 @@ static int ipmi_ipmb_remove(struct i2c_client *client) ipmi_ipmb_stop_thread(iidev); ipmi_unregister_smi(iidev->intf); - - return 0; } static int ipmi_ipmb_probe(struct i2c_client *client) diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index fc742ee9c046..13da021e7c6b 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1281,13 +1281,13 @@ static void shutdown_ssif(void *send_info) } } -static int ssif_remove(struct i2c_client *client) +static void ssif_remove(struct i2c_client *client) { struct ssif_info *ssif_info = i2c_get_clientdata(client); struct ssif_addr_info *addr_info; if (!ssif_info) - return 0; + return; /* * After this point, we won't deliver anything asychronously @@ -1303,8 +1303,6 @@ static int ssif_remove(struct i2c_client *client) } kfree(ssif_info); - - return 0; } static int read_response(struct i2c_client *client, unsigned char *resp) diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index 3170d59d660c..a3aa411389e7 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c @@ -264,13 +264,11 @@ static int st33zp24_i2c_probe(struct i2c_client *client, * @param: client, the i2c_client description (TPM I2C description). * @return: 0 in case of success. */ -static int st33zp24_i2c_remove(struct i2c_client *client) +static void st33zp24_i2c_remove(struct i2c_client *client) { struct tpm_chip *chip = i2c_get_clientdata(client); st33zp24_remove(chip); - - return 0; } static const struct i2c_device_id st33zp24_i2c_id[] = { diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c index d5ac85558214..4be3677c1463 100644 --- a/drivers/char/tpm/tpm_i2c_atmel.c +++ b/drivers/char/tpm/tpm_i2c_atmel.c @@ -179,12 +179,11 @@ static int i2c_atmel_probe(struct i2c_client *client, return tpm_chip_register(chip); } -static int i2c_atmel_remove(struct i2c_client *client) +static void i2c_atmel_remove(struct i2c_client *client) { struct device *dev = &(client->dev); struct tpm_chip *chip = dev_get_drvdata(dev); tpm_chip_unregister(chip); - return 0; } static const struct i2c_device_id i2c_atmel_id[] = { diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index a19d32cb4e94..fd3c3661e646 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c @@ -706,15 +706,13 @@ static int tpm_tis_i2c_probe(struct i2c_client *client, return rc; } -static int tpm_tis_i2c_remove(struct i2c_client *client) +static void tpm_tis_i2c_remove(struct i2c_client *client) { struct tpm_chip *chip = tpm_dev.chip; tpm_chip_unregister(chip); release_locality(chip, tpm_dev.locality, 1); tpm_dev.client = NULL; - - return 0; } static struct i2c_driver tpm_tis_i2c_driver = { diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index b77c18e38662..95c37350cc8e 100644 --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -622,12 +622,11 @@ static int i2c_nuvoton_probe(struct i2c_client *client, return tpm_chip_register(chip); } -static int i2c_nuvoton_remove(struct i2c_client *client) +static void i2c_nuvoton_remove(struct i2c_client *client) { struct tpm_chip *chip = i2c_get_clientdata(client); tpm_chip_unregister(chip); - return 0; } static const struct i2c_device_id i2c_nuvoton_id[] = { diff --git a/drivers/char/tpm/tpm_tis_i2c.c b/drivers/char/tpm/tpm_tis_i2c.c index ba0911b1d1ff..0692510dfcab 100644 --- a/drivers/char/tpm/tpm_tis_i2c.c +++ b/drivers/char/tpm/tpm_tis_i2c.c @@ -351,13 +351,12 @@ static int tpm_tis_i2c_probe(struct i2c_client *dev, NULL); } -static int tpm_tis_i2c_remove(struct i2c_client *client) +static void tpm_tis_i2c_remove(struct i2c_client *client) { struct tpm_chip *chip = i2c_get_clientdata(client); tpm_chip_unregister(chip); tpm_tis_remove(chip); - return 0; } static const struct i2c_device_id tpm_tis_i2c_id[] = { diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c index 974479a1ec5a..77cea5b31c6e 100644 --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c @@ -763,20 +763,18 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client) * - 0: Success. * - -errno: A POSIX error code. */ -static int tpm_cr50_i2c_remove(struct i2c_client *client) +static void tpm_cr50_i2c_remove(struct i2c_client *client) { struct tpm_chip *chip = i2c_get_clientdata(client); struct device *dev = &client->dev; if (!chip) { dev_crit(dev, "Could not get client data at remove, memory corruption ahead\n"); - return 0; + return; } tpm_chip_unregister(chip); tpm_cr50_release_locality(chip, true); - - return 0; } static SIMPLE_DEV_PM_OPS(cr50_i2c_pm, tpm_pm_suspend, tpm_pm_resume); |