Skip to content

Commit 6a8f359

Browse files
Uwe Kleine-Königwsakernel
Uwe Kleine-König
authored andcommitted
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 <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 22a2343 commit 6a8f359

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

arch/arm/mach-davinci/board-da850-evm.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
516516
return ret;
517517
}
518518

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)
521521
{
522522
platform_device_unregister(&da850_evm_ui_keys_device);
523523

@@ -529,8 +529,6 @@ static int da850_evm_ui_expander_teardown(struct i2c_client *client,
529529
gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C);
530530
gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B);
531531
gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A);
532-
533-
return 0;
534532
}
535533

536534
/* assign the baseboard expander's GPIOs after the UI board's */
@@ -697,13 +695,11 @@ static int da850_evm_bb_expander_setup(struct i2c_client *client,
697695
return ret;
698696
}
699697

700-
static int da850_evm_bb_expander_teardown(struct i2c_client *client,
701-
unsigned gpio, unsigned ngpio, void *c)
698+
static void da850_evm_bb_expander_teardown(struct i2c_client *client,
699+
unsigned gpio, unsigned ngpio, void *c)
702700
{
703701
platform_device_unregister(&da850_evm_bb_leds_device);
704702
platform_device_unregister(&da850_evm_bb_keys_device);
705-
706-
return 0;
707703
}
708704

709705
static struct pca953x_platform_data da850_evm_ui_expander_info = {

drivers/gpio/gpio-pca953x.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -1105,20 +1105,15 @@ static int pca953x_remove(struct i2c_client *client)
11051105
{
11061106
struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev);
11071107
struct pca953x_chip *chip = i2c_get_clientdata(client);
1108-
int ret;
11091108

11101109
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);
11171112
}
11181113

11191114
regulator_disable(chip->regulator);
11201115

1121-
return ret;
1116+
return 0;
11221117
}
11231118

11241119
#ifdef CONFIG_PM_SLEEP

include/linux/platform_data/pca953x.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct pca953x_platform_data {
2222
int (*setup)(struct i2c_client *client,
2323
unsigned gpio, unsigned ngpio,
2424
void *context);
25-
int (*teardown)(struct i2c_client *client,
25+
void (*teardown)(struct i2c_client *client,
2626
unsigned gpio, unsigned ngpio,
2727
void *context);
2828
const char *const *names;

0 commit comments

Comments
 (0)