diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-10-22 13:17:07 +0300 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2022-05-04 20:37:51 +0300 |
commit | c55f75c4f9c01934341b59ba8ac7492c13423e5b (patch) | |
tree | d3209a46fd21e343e1d6ba95fab384f94b43121a /drivers/leds | |
parent | 96c59c8ba801bad56f5e635640e1371b1680e42e (diff) | |
download | linux-c55f75c4f9c01934341b59ba8ac7492c13423e5b.tar.xz |
leds: pca9532: Make pca9532_destroy_devices() return void
Up to now pca9532_destroy_devices() returns always zero because it's
always called with data != NULL. Remove the never-taken error path and
make it return void which makes it easier to see in the callers that
there is no error to handle.
Also the return value of i2c remove callbacks is ignored anyway.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-pca9532.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c index 017794bb87ae..f72b5d1be3a6 100644 --- a/drivers/leds/leds-pca9532.c +++ b/drivers/leds/leds-pca9532.c @@ -318,13 +318,10 @@ static int pca9532_gpio_direction_output(struct gpio_chip *gc, unsigned offset, } #endif /* CONFIG_LEDS_PCA9532_GPIO */ -static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs) +static void pca9532_destroy_devices(struct pca9532_data *data, int n_devs) { int i = n_devs; - if (!data) - return -EINVAL; - while (--i >= 0) { switch (data->leds[i].type) { case PCA9532_TYPE_NONE: @@ -346,8 +343,6 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs) if (data->gpio.parent) gpiochip_remove(&data->gpio); #endif - - return 0; } static int pca9532_configure(struct i2c_client *client, @@ -555,7 +550,9 @@ static int pca9532_remove(struct i2c_client *client) { struct pca9532_data *data = i2c_get_clientdata(client); - return pca9532_destroy_devices(data, data->chip_info->num_leds); + pca9532_destroy_devices(data, data->chip_info->num_leds); + + return 0; } module_i2c_driver(pca9532_driver); |