diff options
author | Milo(Woogyom) Kim <milo.kim@ti.com> | 2013-02-05 05:12:47 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-02-06 18:59:28 -0500 |
commit | d9067d28461cb2e817cacb84c727959cbd57d247 (patch) | |
tree | e145bb6f5aa667ac84fedb409dd0dadbb401dcd9 /drivers/leds/leds-lp55xx-common.c | |
parent | c3a68ebfcd22abc186f2328149732c801449b297 (diff) |
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>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.c')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index dcd64f5285e8..cd19027895e5 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c | |||
@@ -344,11 +344,7 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) | |||
344 | return 0; | 344 | return 0; |
345 | 345 | ||
346 | err_init_led: | 346 | err_init_led: |
347 | for (i = 0; i < chip->num_leds; i++) { | 347 | lp55xx_unregister_leds(led, chip); |
348 | each = led + i; | ||
349 | led_classdev_unregister(&each->cdev); | ||
350 | flush_work(&each->brightness_work); | ||
351 | } | ||
352 | return ret; | 348 | return ret; |
353 | } | 349 | } |
354 | EXPORT_SYMBOL_GPL(lp55xx_register_leds); | 350 | EXPORT_SYMBOL_GPL(lp55xx_register_leds); |