leds-lp55xx: fix error condition in lp55xx_register_leds()
Use lp55xx_unregister_leds() rather than duplicate code. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
parent
c3a68ebfcd
commit
d9067d2846
1 changed files with 1 additions and 5 deletions
|
@ -344,11 +344,7 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
|
|||
return 0;
|
||||
|
||||
err_init_led:
|
||||
for (i = 0; i < chip->num_leds; i++) {
|
||||
each = led + i;
|
||||
led_classdev_unregister(&each->cdev);
|
||||
flush_work(&each->brightness_work);
|
||||
}
|
||||
lp55xx_unregister_leds(led, chip);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(lp55xx_register_leds);
|
||||
|
|
Loading…
Reference in a new issue