]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
leds-lp55xx: add new function for removing device attribtues
authorMilo(Woogyom) Kim <milo.kim@ti.com>
Tue, 5 Feb 2013 10:23:04 +0000 (19:23 +0900)
committerBryan Wu <cooloney@gmail.com>
Wed, 6 Feb 2013 23:59:29 +0000 (15:59 -0800)
 lp55xx_unregister_sysfs() is used for removing lp55xx device attributes.
 Chip specific and engine attributes are removed on unloading the driver.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-lp55xx-common.c
drivers/leds/leds-lp55xx-common.h

index 9638ad4dc635dddce4e67806e3d32b0524fcf10a..782ab84fe65fc0f0936a0eae95a9dcaf4b439948 100644 (file)
@@ -509,6 +509,18 @@ dev_specific_attrs:
 }
 EXPORT_SYMBOL_GPL(lp55xx_register_sysfs);
 
+void lp55xx_unregister_sysfs(struct lp55xx_chip *chip)
+{
+       struct device *dev = &chip->cl->dev;
+       struct lp55xx_device_config *cfg = chip->cfg;
+
+       if (cfg->dev_attr_group)
+               sysfs_remove_group(&dev->kobj, cfg->dev_attr_group);
+
+       sysfs_remove_group(&dev->kobj, &lp55xx_engine_attr_group);
+}
+EXPORT_SYMBOL_GPL(lp55xx_unregister_sysfs);
+
 MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>");
 MODULE_DESCRIPTION("LP55xx Common Driver");
 MODULE_LICENSE("GPL");
index 64eb78da1c4be6e161f21ef8243403b6fded4933..ece4761a1302bbac7d6f522e7a57e890ba9f1ae3 100644 (file)
@@ -129,5 +129,6 @@ extern void lp55xx_unregister_leds(struct lp55xx_led *led,
 
 /* common device attributes functions */
 extern int lp55xx_register_sysfs(struct lp55xx_chip *chip);
+extern void lp55xx_unregister_sysfs(struct lp55xx_chip *chip);
 
 #endif /* _LEDS_LP55XX_COMMON_H */