1
0
Fork 0

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>
hifive-unleashed-5.1
Johan Hovold 2014-06-25 10:08:55 -07:00 committed by Bryan Wu
parent f254bea49d
commit 660216bf82
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}