summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lp55xx-common.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2014-06-25 21:08:55 +0400
committerBryan Wu <cooloney@gmail.com>2014-06-28 00:44:04 +0400
commit660216bf82e0cd65603c0935193c1f7c4aca04fb (patch)
tree811bc2854eb9dbeeb9eaff80d07783b41c18b53b /drivers/leds/leds-lp55xx-common.c
parentf254bea49d05ee80b09d577947bd3b937e3a304a (diff)
downloadlinux-660216bf82e0cd65603c0935193c1f7c4aca04fb.tar.xz
leds: lp55xx-common: fix sysfs entry leak
Make sure the sysfs group is removed when the LEDs are unregistered. Signed-off-by: Johan Hovold <johan@kernel.org> 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 88317b4f7bf3..3fbfb31602c7 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -520,6 +520,8 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
for (i = 0; i < chip->num_leds; i++) {
each = led + i;
+ sysfs_remove_group(&each->cdev.dev->kobj,
+ &lp55xx_led_attr_group);
led_classdev_unregister(&each->cdev);
flush_work(&each->brightness_work);
}