]> git.baikalelectronics.ru Git - kernel.git/commitdiff
gpio: pca953x: Make platform teardown callback return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 15 Aug 2022 08:02:29 +0000 (10:02 +0200)
committerWolfram Sang <wsa@kernel.org>
Tue, 16 Aug 2022 10:34:13 +0000 (12:34 +0200)
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>
arch/arm/mach-davinci/board-da850-evm.c
drivers/gpio/gpio-pca953x.c
include/linux/platform_data/pca953x.h

index 92d74bc71967dd6e9310e6b1f189dfdf3616e2e5..d752ee2b30ff94919020e4343de9a1af5d4aeffb 100644 (file)
@@ -516,8 +516,8 @@ exp_setup_sela_fail:
        return ret;
 }
 
-static int da850_evm_ui_expander_teardown(struct i2c_client *client,
-                                       unsigned gpio, unsigned ngpio, void *c)
+static void da850_evm_ui_expander_teardown(struct i2c_client *client,
+                                          unsigned gpio, unsigned ngpio, void *c)
 {
        platform_device_unregister(&da850_evm_ui_keys_device);
 
@@ -529,8 +529,6 @@ static int da850_evm_ui_expander_teardown(struct i2c_client *client,
        gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C);
        gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B);
        gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A);
-
-       return 0;
 }
 
 /* assign the baseboard expander's GPIOs after the UI board's */
@@ -697,13 +695,11 @@ io_exp_setup_sw_fail:
        return ret;
 }
 
-static int da850_evm_bb_expander_teardown(struct i2c_client *client,
-                                       unsigned gpio, unsigned ngpio, void *c)
+static void da850_evm_bb_expander_teardown(struct i2c_client *client,
+                                          unsigned gpio, unsigned ngpio, void *c)
 {
        platform_device_unregister(&da850_evm_bb_leds_device);
        platform_device_unregister(&da850_evm_bb_keys_device);
-
-       return 0;
 }
 
 static struct pca953x_platform_data da850_evm_ui_expander_info = {
index ecd7d169470b068ddbbc9685ae33a1f0a860cd32..1860e566eb94a02f9716a51a64f7cd50a4c1d352 100644 (file)
@@ -1105,20 +1105,15 @@ static int pca953x_remove(struct i2c_client *client)
 {
        struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev);
        struct pca953x_chip *chip = i2c_get_clientdata(client);
-       int ret;
 
        if (pdata && pdata->teardown) {
-               ret = pdata->teardown(client, chip->gpio_chip.base,
-                                     chip->gpio_chip.ngpio, pdata->context);
-               if (ret < 0)
-                       dev_err(&client->dev, "teardown failed, %d\n", ret);
-       } else {
-               ret = 0;
+               pdata->teardown(client, chip->gpio_chip.base,
+                               chip->gpio_chip.ngpio, pdata->context);
        }
 
        regulator_disable(chip->regulator);
 
-       return ret;
+       return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
index 4eb53e02399786300f8f27f3682504a8696f83a1..96c1a14ab3657aa367ae1e9ba5a79feaa8710430 100644 (file)
@@ -22,7 +22,7 @@ struct pca953x_platform_data {
        int             (*setup)(struct i2c_client *client,
                                unsigned gpio, unsigned ngpio,
                                void *context);
-       int             (*teardown)(struct i2c_client *client,
+       void            (*teardown)(struct i2c_client *client,
                                unsigned gpio, unsigned ngpio,
                                void *context);
        const char      *const *names;