Skip to content

Commit c55f75c

Browse files
Uwe Kleine-Königpavelmachek
authored andcommitted
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>
1 parent 96c59c8 commit c55f75c

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

drivers/leds/leds-pca9532.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,10 @@ static int pca9532_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
318318
}
319319
#endif /* CONFIG_LEDS_PCA9532_GPIO */
320320

321-
static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
321+
static void pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
322322
{
323323
int i = n_devs;
324324

325-
if (!data)
326-
return -EINVAL;
327-
328325
while (--i >= 0) {
329326
switch (data->leds[i].type) {
330327
case PCA9532_TYPE_NONE:
@@ -346,8 +343,6 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
346343
if (data->gpio.parent)
347344
gpiochip_remove(&data->gpio);
348345
#endif
349-
350-
return 0;
351346
}
352347

353348
static int pca9532_configure(struct i2c_client *client,
@@ -555,7 +550,9 @@ static int pca9532_remove(struct i2c_client *client)
555550
{
556551
struct pca9532_data *data = i2c_get_clientdata(client);
557552

558-
return pca9532_destroy_devices(data, data->chip_info->num_leds);
553+
pca9532_destroy_devices(data, data->chip_info->num_leds);
554+
555+
return 0;
559556
}
560557

561558
module_i2c_driver(pca9532_driver);

0 commit comments

Comments
 (0)