Commit d9067d28 authored by Milo(Woogyom) Kim's avatar Milo(Woogyom) Kim Committed by Bryan Wu

leds-lp55xx: fix error condition in lp55xx_register_leds()

 Use lp55xx_unregister_leds() rather than duplicate code.
Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent c3a68ebf
...@@ -344,11 +344,7 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) ...@@ -344,11 +344,7 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
return 0; return 0;
err_init_led: err_init_led:
for (i = 0; i < chip->num_leds; i++) { lp55xx_unregister_leds(led, chip);
each = led + i;
led_classdev_unregister(&each->cdev);
flush_work(&each->brightness_work);
}
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(lp55xx_register_leds); EXPORT_SYMBOL_GPL(lp55xx_register_leds);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment