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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 28, 2022 at 04:03:06PM +0200, Uwe Kleine-König wrote:
> as announced in
> https://lore.kernel.org/linux-i2c/20220609091018.q52fhowlsdbdkct5@xxxxxxxxxxxxxx
> I intend to change the remove prototype for i2c drivers to remove void.
> 
> As this touches quite some drivers, the plan is to submit this change
> for inclusion after the next merge window and get it quickly into next
> that other subsystems have enough time to adapt.
> 
> Still to give the opportunity to comment I send the patch set out based
> on v5.19-rc4. There are still a few patches in next that are required,
> namely:
> 
> 	d04d46dd82ad iio:magnetometer:mbc150: Make bmc150_magn_remove() return void
> 	7576bc05b360 iio:light:vcnl4035: Improve error reporting for problems during .remove()
> 	ab91da2f2574 iio:light:vcnl4000: Improve error reporting for problems during .remove()
> 	5049646718d7 iio:light:us5182d: Improve error reporting for problems during .remove()
> 	be9f6004be88 iio:light:pa12203001: Improve error reporting for problems during .remove()
> 	730cd2f54eba iio:chemical:ccs811: Improve error reporting for problems during .remove()
> 	a76209246d9f iio:chemical:atlas: Improve error reporting for problems during .remove()
> 	8f760ce7affd iio:adc:ti-ads1015: Improve error reporting for problems during .remove()
> 	ffa952e95d8c iio:adc:ina2xx: Improve error reporting for problems during .remove()
> 	48d1ae774099 iio: health: afe4404: Remove duplicated error reporting in .remove()
> 	8dc0a72795e4 iio:light:tsl2583: Remove duplicated error reporting in .remove()
> 	58a6df5580bb iio:light:stk3310: Remove duplicated error reporting in .remove()
> 	44ceb791182a iio:light:opt3001: Remove duplicated error reporting in .remove()
> 	f0e34d262567 iio:light:jsa1212: Remove duplicated error reporting in .remove()
> 	8d3d6baa4990 iio:light:isl29028: Remove duplicated error reporting in .remove()
> 	5004e24a466c iio:light:bh1780: Remove duplicated error reporting in .remove()
> 	1db6926d611d iio:accel:stk8ba50: Remove duplicated error reporting in .remove()
> 	1aec857d50ce iio:accel:stk8312: Remove duplicated error reporting in .remove()
> 	aae59bdf2585 iio:accel:mc3230: Remove duplicated error reporting in .remove()
> 	7df7563b16aa crypto: atmel-ecc - Remove duplicated error reporting in .remove()
> 	99ad11e06be8 i2c: dummy: Drop no-op remove function
> 	84965cc60e64 ASoC: cs35l45: Make cs35l45_remove() return void
> 	fb68cb963bb7 ASoC: da732x: Drop no-op remove function
> 	3cce931a5e44 ASoC: lm49453: Drop no-op remove function
> 	8a291eebeb63 ASoC: da7219: Drop no-op remove function
> 	60391d788a22 ASoC: ak4642: Drop no-op remove function
> 	51bd0abd873d extcon: fsa9480: Drop no-op remove function
> 
> I hope and assume they will all be included in v5.20-rc1. There are 5
> more patches required that didn't made it into next yet (i.e. patches #1
> - #5 of this series).
> 
> There are also two drivers in next that need adaption:
> 
> 	drivers/gpu/drm/bridge/ti-dlpc3433.c
> 	drivers/tty/serial/max310x.c

There is now a third driver in next that is affected:
drivers/char/tpm/tpm_tis_i2c.c that was added with commit
88f3b0f519c068ad29c92e965239a7900a2deea3 to next.

A tree containing patched #1 to #5 merges just fine with next/master.
When merging patch 6 into the result the merge resolution looks as
follows:

diff --cc drivers/gpu/drm/bridge/parade-ps8640.c
index 31e88cb39f8a,a09d1828d8e1..000000000000
--- a/drivers/gpu/drm/bridge/parade-ps8640.c
+++ b/drivers/gpu/drm/bridge/parade-ps8640.c
diff --cc drivers/gpu/drm/bridge/ti-sn65dsi83.c
index dc26640e7d9b,8f93e374848c..000000000000
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@@ -712,8 -731,7 +712,6 @@@ static void sn65dsi83_remove(struct i2c
  	struct sn65dsi83 *ctx = i2c_get_clientdata(client);
  
  	drm_bridge_remove(&ctx->bridge);
- 
- 	return 0;
 -	of_node_put(ctx->host_node);
  }
  
  static struct i2c_device_id sn65dsi83_id[] = {
diff --cc drivers/iio/accel/bma400_i2c.c
index 1ba2a982ea73,90c99ab8c8f2..000000000000
--- a/drivers/iio/accel/bma400_i2c.c
+++ b/drivers/iio/accel/bma400_i2c.c
diff --cc drivers/input/keyboard/adp5588-keys.c
index 1a1a05d7cd42,b5666d650994..000000000000
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@@ -590,21 -584,43 +590,20 @@@ static int adp5588_probe(struct i2c_cli
  
  	dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
  	return 0;
 -
 - err_free_irq:
 -	free_irq(client->irq, kpad);
 -	cancel_delayed_work_sync(&kpad->work);
 - err_unreg_dev:
 -	input_unregister_device(input);
 -	input = NULL;
 - err_free_mem:
 -	input_free_device(input);
 -	kfree(kpad);
 -
 -	return error;
  }
  
- static int adp5588_remove(struct i2c_client *client)
+ static void adp5588_remove(struct i2c_client *client)
  {
 -	struct adp5588_kpad *kpad = i2c_get_clientdata(client);
 -
  	adp5588_write(client, CFG, 0);
 -	free_irq(client->irq, kpad);
 -	cancel_delayed_work_sync(&kpad->work);
 -	input_unregister_device(kpad->input);
 -	adp5588_gpio_remove(kpad);
 -	kfree(kpad);
 +
 +	/* all resources will be freed by devm */
- 	return 0;
  }
  
 -#ifdef CONFIG_PM
 -static int adp5588_suspend(struct device *dev)
 +static int __maybe_unused adp5588_suspend(struct device *dev)
  {
 -	struct adp5588_kpad *kpad = dev_get_drvdata(dev);
 -	struct i2c_client *client = kpad->client;
 +	struct i2c_client *client = to_i2c_client(dev);
  
  	disable_irq(client->irq);
 -	cancel_delayed_work_sync(&kpad->work);
 -
 -	if (device_may_wakeup(&client->dev))
 -		enable_irq_wake(client->irq);
  
  	return 0;
  }
diff --git a/drivers/char/tpm/tpm_tis_i2c.c b/drivers/char/tpm/tpm_tis_i2c.c
index 8e0686fe4eb1..5299e30657b8 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/gpu/drm/bridge/ti-dlpc3433.c b/drivers/gpu/drm/bridge/ti-dlpc3433.c
index 06e519798ac5..c1b94bc183e6 100644
--- a/drivers/gpu/drm/bridge/ti-dlpc3433.c
+++ b/drivers/gpu/drm/bridge/ti-dlpc3433.c
@@ -378,14 +378,12 @@ static int dlpc3433_probe(struct i2c_client *client)
 	return ret;
 }
 
-static int dlpc3433_remove(struct i2c_client *client)
+static void dlpc3433_remove(struct i2c_client *client)
 {
 	struct dlpc *dlpc = i2c_get_clientdata(client);
 
 	drm_bridge_remove(&dlpc->bridge);
 	of_node_put(dlpc->host_node);
-
-	return 0;
 }
 
 static const struct i2c_device_id dlpc3433_id[] = {
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index e162bfb44080..8a4d0defa0cb 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -1616,11 +1616,9 @@ static int max310x_i2c_probe(struct i2c_client *client)
 			     regmaps, client->irq);
 }
 
-static int max310x_i2c_remove(struct i2c_client *client)
+static void max310x_i2c_remove(struct i2c_client *client)
 {
 	max310x_remove(&client->dev);
-
-	return 0;
 }
 
 static struct i2c_driver max310x_i2c_driver = {

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux