Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: pca953x: Make platform teardown callback return void

All platforms that provide a teardown callback return 0. New users are
supposed to not make use of platform support, so there is no
functionality lost.

This patch is a preparation for making i2c remove callbacks return void.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

authored by

Uwe Kleine-König and committed by
Wolfram Sang
6a8f359c 22a23436

+8 -17
+4 -8
arch/arm/mach-davinci/board-da850-evm.c
··· 516 516 return ret; 517 517 } 518 518 519 - static int da850_evm_ui_expander_teardown(struct i2c_client *client, 520 - unsigned gpio, unsigned ngpio, void *c) 519 + static void da850_evm_ui_expander_teardown(struct i2c_client *client, 520 + unsigned gpio, unsigned ngpio, void *c) 521 521 { 522 522 platform_device_unregister(&da850_evm_ui_keys_device); 523 523 ··· 529 529 gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C); 530 530 gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B); 531 531 gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A); 532 - 533 - return 0; 534 532 } 535 533 536 534 /* assign the baseboard expander's GPIOs after the UI board's */ ··· 695 697 return ret; 696 698 } 697 699 698 - static int da850_evm_bb_expander_teardown(struct i2c_client *client, 699 - unsigned gpio, unsigned ngpio, void *c) 700 + static void da850_evm_bb_expander_teardown(struct i2c_client *client, 701 + unsigned gpio, unsigned ngpio, void *c) 700 702 { 701 703 platform_device_unregister(&da850_evm_bb_leds_device); 702 704 platform_device_unregister(&da850_evm_bb_keys_device); 703 - 704 - return 0; 705 705 } 706 706 707 707 static struct pca953x_platform_data da850_evm_ui_expander_info = {
+3 -8
drivers/gpio/gpio-pca953x.c
··· 1105 1105 { 1106 1106 struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev); 1107 1107 struct pca953x_chip *chip = i2c_get_clientdata(client); 1108 - int ret; 1109 1108 1110 1109 if (pdata && pdata->teardown) { 1111 - ret = pdata->teardown(client, chip->gpio_chip.base, 1112 - chip->gpio_chip.ngpio, pdata->context); 1113 - if (ret < 0) 1114 - dev_err(&client->dev, "teardown failed, %d\n", ret); 1115 - } else { 1116 - ret = 0; 1110 + pdata->teardown(client, chip->gpio_chip.base, 1111 + chip->gpio_chip.ngpio, pdata->context); 1117 1112 } 1118 1113 1119 1114 regulator_disable(chip->regulator); 1120 1115 1121 - return ret; 1116 + return 0; 1122 1117 } 1123 1118 1124 1119 #ifdef CONFIG_PM_SLEEP
+1 -1
include/linux/platform_data/pca953x.h
··· 22 22 int (*setup)(struct i2c_client *client, 23 23 unsigned gpio, unsigned ngpio, 24 24 void *context); 25 - int (*teardown)(struct i2c_client *client, 25 + void (*teardown)(struct i2c_client *client, 26 26 unsigned gpio, unsigned ngpio, 27 27 void *context); 28 28 const char *const *names;