Thread (1 message) 1 message, 1 author, 2022-06-29

Re: [PATCH 6/6] i2c: Make remove callback return void

From: Luca Ceresoli <luca@lucaceresoli.net>
Date: 2022-06-29 21:20:31
Also in: chrome-platform, dri-devel, linux-clk, linux-crypto, linux-devicetree, linux-fbdev, linux-gpio, linux-hwmon, linux-i2c, linux-iio, linux-input, linux-integrity, linux-leds, linux-media, linux-mediatek, linux-omap, linux-pm, linux-pwm, linux-rtc, linux-serial, linux-staging, linux-usb, linux-watchdog, linuxppc-dev, netdev, platform-driver-x86

Possibly related (same subject, not in this thread)

Hi,

[keeping only individuals and lists in Cc to avoid bounces]

On 28/06/22 16:03, Uwe Kleine-König wrote:
From: Uwe Kleine-König <redacted>

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.

Signed-off-by: Uwe Kleine-König <redacted>
For versaclock:
quoted hunk
diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
index e7be3e54b9be..657493ecce4c 100644
--- a/drivers/clk/clk-versaclock5.c
+++ b/drivers/clk/clk-versaclock5.c
@@ -1138,7 +1138,7 @@ static int vc5_probe(struct i2c_client *client)
 	return ret;
 }
 
-static int vc5_remove(struct i2c_client *client)
+static void vc5_remove(struct i2c_client *client)
 {
 	struct vc5_driver_data *vc5 = i2c_get_clientdata(client);
 
@@ -1146,8 +1146,6 @@ static int vc5_remove(struct i2c_client *client)
 
 	if (vc5->chip_info->flags & VC5_HAS_INTERNAL_XTAL)
 		clk_unregister_fixed_rate(vc5->pin_xin);
-
-	return 0;
 }
 
 static int __maybe_unused vc5_suspend(struct device *dev)
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

-- 
Luca

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help