From: Milo(Woogyom) Kim Date: Tue, 5 Feb 2013 10:23:04 +0000 (+0900) Subject: leds-lp55xx: add new function for removing device attribtues X-Git-Tag: upstream/snapshot3+hdmi~5648^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba6fa84651ff9a609e0ceb8265e3335ab6ed656d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git leds-lp55xx: add new function for removing device attribtues 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 Signed-off-by: Bryan Wu --- diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 9638ad4..782ab84 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -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 "); MODULE_DESCRIPTION("LP55xx Common Driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/leds/leds-lp55xx-common.h b/drivers/leds/leds-lp55xx-common.h index 64eb78d..ece4761 100644 --- a/drivers/leds/leds-lp55xx-common.h +++ b/drivers/leds/leds-lp55xx-common.h @@ -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 */