aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp55xx-common.c
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 05:11:18 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-06 18:59:28 -0500
commitc3a68ebfcd22abc186f2328149732c801449b297 (patch)
tree253db155491541accda86b0900dce9856213a9ab /drivers/leds/leds-lp55xx-common.c
parenta96bfa135ddc8045166fc6311ce4d21bfcb8d13d (diff)
leds-lp55xx: use lp55xx_unregister_leds()
To unregister led class devices and sysfs attributes, LP5521 and LP5523 have each driver function. This patch makes both drivers simple using common driver function, lp55xx_unregister_leds(). And some unused variables are removed. 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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 6b3d03709f5f..dcd64f5285e8 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -353,6 +353,22 @@ err_init_led:
353} 353}
354EXPORT_SYMBOL_GPL(lp55xx_register_leds); 354EXPORT_SYMBOL_GPL(lp55xx_register_leds);
355 355
356void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
357{
358 int i;
359 struct lp55xx_led *each;
360 struct kobject *kobj;
361
362 for (i = 0; i < chip->num_leds; i++) {
363 each = led + i;
364 kobj = &led->cdev.dev->kobj;
365 sysfs_remove_group(kobj, &lp55xx_led_attr_group);
366 led_classdev_unregister(&each->cdev);
367 flush_work(&each->brightness_work);
368 }
369}
370EXPORT_SYMBOL_GPL(lp55xx_unregister_leds);
371
356MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>"); 372MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>");
357MODULE_DESCRIPTION("LP55xx Common Driver"); 373MODULE_DESCRIPTION("LP55xx Common Driver");
358MODULE_LICENSE("GPL"); 374MODULE_LICENSE("GPL");