From ed5c2f5fd10dda07263f79f338a512c0f49f76f5 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König 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/nfc/fdp/i2c.c | 4 +--- drivers/nfc/microread/i2c.c | 4 +--- drivers/nfc/nfcmrvl/i2c.c | 4 +--- drivers/nfc/nxp-nci/i2c.c | 4 +--- drivers/nfc/pn533/i2c.c | 4 +--- drivers/nfc/pn544/i2c.c | 4 +--- drivers/nfc/s3fwrn5/i2c.c | 4 +--- drivers/nfc/st-nci/i2c.c | 4 +--- drivers/nfc/st21nfca/i2c.c | 4 +--- 9 files changed, 9 insertions(+), 27 deletions(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index 28a9e1eb9bcf..2d53e0f88d2f 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c @@ -336,14 +336,12 @@ static int fdp_nci_i2c_probe(struct i2c_client *client) return 0; } -static int fdp_nci_i2c_remove(struct i2c_client *client) +static void fdp_nci_i2c_remove(struct i2c_client *client) { struct fdp_i2c_phy *phy = i2c_get_clientdata(client); fdp_nci_remove(phy->ndev); fdp_nci_i2c_disable(phy); - - return 0; } static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = { diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c index 067295124eb9..5eaa18f81355 100644 --- a/drivers/nfc/microread/i2c.c +++ b/drivers/nfc/microread/i2c.c @@ -268,15 +268,13 @@ err_irq: return r; } -static int microread_i2c_remove(struct i2c_client *client) +static void microread_i2c_remove(struct i2c_client *client) { struct microread_i2c_phy *phy = i2c_get_clientdata(client); microread_remove(phy->hdev); free_irq(client->irq, phy); - - return 0; } static const struct i2c_device_id microread_i2c_id[] = { diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c index 01329b91d59d..acef0cfd76af 100644 --- a/drivers/nfc/nfcmrvl/i2c.c +++ b/drivers/nfc/nfcmrvl/i2c.c @@ -231,13 +231,11 @@ static int nfcmrvl_i2c_probe(struct i2c_client *client, return 0; } -static int nfcmrvl_i2c_remove(struct i2c_client *client) +static void nfcmrvl_i2c_remove(struct i2c_client *client) { struct nfcmrvl_i2c_drv_data *drv_data = i2c_get_clientdata(client); nfcmrvl_nci_unregister_dev(drv_data->priv); - - return 0; } diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index ae2ba08d8ac3..ec6446511984 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -314,14 +314,12 @@ static int nxp_nci_i2c_probe(struct i2c_client *client, return r; } -static int nxp_nci_i2c_remove(struct i2c_client *client) +static void nxp_nci_i2c_remove(struct i2c_client *client) { struct nxp_nci_i2c_phy *phy = i2c_get_clientdata(client); nxp_nci_remove(phy->ndev); free_irq(client->irq, phy); - - return 0; } static const struct i2c_device_id nxp_nci_i2c_id_table[] = { diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c index 673eb5e9b887..ddf3db286bad 100644 --- a/drivers/nfc/pn533/i2c.c +++ b/drivers/nfc/pn533/i2c.c @@ -227,7 +227,7 @@ nfc_alloc_err: return r; } -static int pn533_i2c_remove(struct i2c_client *client) +static void pn533_i2c_remove(struct i2c_client *client) { struct pn533_i2c_phy *phy = i2c_get_clientdata(client); @@ -235,8 +235,6 @@ static int pn533_i2c_remove(struct i2c_client *client) pn53x_unregister_nfc(phy->priv); pn53x_common_clean(phy->priv); - - return 0; } static const struct of_device_id of_pn533_i2c_match[] __maybe_unused = { diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 62a0f1a010cb..9e754abcfa2a 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -928,7 +928,7 @@ static int pn544_hci_i2c_probe(struct i2c_client *client, return 0; } -static int pn544_hci_i2c_remove(struct i2c_client *client) +static void pn544_hci_i2c_remove(struct i2c_client *client) { struct pn544_i2c_phy *phy = i2c_get_clientdata(client); @@ -940,8 +940,6 @@ static int pn544_hci_i2c_remove(struct i2c_client *client) if (phy->powered) pn544_hci_i2c_disable(phy); - - return 0; } static const struct of_device_id of_pn544_i2c_match[] __maybe_unused = { diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c index 4d1cf1bb55b0..f824dc7099ce 100644 --- a/drivers/nfc/s3fwrn5/i2c.c +++ b/drivers/nfc/s3fwrn5/i2c.c @@ -246,14 +246,12 @@ disable_clk: return ret; } -static int s3fwrn5_i2c_remove(struct i2c_client *client) +static void s3fwrn5_i2c_remove(struct i2c_client *client) { struct s3fwrn5_i2c_phy *phy = i2c_get_clientdata(client); s3fwrn5_remove(phy->common.ndev); clk_disable_unprepare(phy->clk); - - return 0; } static const struct i2c_device_id s3fwrn5_i2c_id_table[] = { diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index cbd968f013c7..89fa24d71bef 100644 --- a/drivers/nfc/st-nci/i2c.c +++ b/drivers/nfc/st-nci/i2c.c @@ -250,13 +250,11 @@ static int st_nci_i2c_probe(struct i2c_client *client, return r; } -static int st_nci_i2c_remove(struct i2c_client *client) +static void st_nci_i2c_remove(struct i2c_client *client) { struct st_nci_i2c_phy *phy = i2c_get_clientdata(client); ndlc_remove(phy->ndlc); - - return 0; } static const struct i2c_device_id st_nci_i2c_id_table[] = { diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index 42dc0e5eb161..76b55986bcf8 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -562,7 +562,7 @@ out_free: return r; } -static int st21nfca_hci_i2c_remove(struct i2c_client *client) +static void st21nfca_hci_i2c_remove(struct i2c_client *client) { struct st21nfca_i2c_phy *phy = i2c_get_clientdata(client); @@ -571,8 +571,6 @@ static int st21nfca_hci_i2c_remove(struct i2c_client *client) if (phy->powered) st21nfca_hci_i2c_disable(phy); kfree_skb(phy->pending_skb); - - return 0; } static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = { -- cgit v1.2.3