[PATCH 17/28] leds-lp5521/5523: use lp55xx common unregister sysfsfunction

From: Kim, Milo
Date: Fri Oct 05 2012 - 04:20:21 EST


While loading the driver, lp55xx common device attributes are registered.
On removing the driver, the attributes should be unregistered.
Old sysfs function is removed.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@xxxxxx>
---
drivers/leds/leds-lp5521.c | 10 ++--------
drivers/leds/leds-lp5523.c | 9 +--------
2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index a5aae05..786b539 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -452,13 +452,6 @@ static const struct attribute_group lp5521_group = {
.attrs = lp5521_attributes,
};

-static void lp5521_unregister_sysfs(struct i2c_client *client)
-{
- struct device *dev = &client->dev;
-
- sysfs_remove_group(&dev->kobj, &lp5521_group);
-}
-
/* Chip specific configurations */
static struct lp55xx_device_config lp5521_cfg = {
.max_channel = LP5521_MAX_LEDS,
@@ -541,7 +534,8 @@ static int __devexit lp5521_remove(struct i2c_client *client)
struct lp55xx_chip *chip = led->chip;

lp5521_stop_engine(chip);
- lp5521_unregister_sysfs(client);
+
+ lp55xx_unregister_sysfs(chip);

for (i = 0; i < old_chip->num_leds; i++) {
led_classdev_unregister(&old_chip->leds[i].cdev);
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index c54785c..c9229fc 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -503,13 +503,6 @@ static const struct attribute_group lp5523_group = {
.attrs = lp5523_attributes,
};

-static void lp5523_unregister_sysfs(struct i2c_client *client)
-{
- struct device *dev = &client->dev;
-
- sysfs_remove_group(&dev->kobj, &lp5523_group);
-}
-
/*--------------------------------------------------------------*/
/* Probe, Attach, Remove */
/*--------------------------------------------------------------*/
@@ -597,7 +590,7 @@ static int lp5523_remove(struct i2c_client *client)

lp5523_stop_engine(chip);

- lp5523_unregister_sysfs(client);
+ lp55xx_unregister_sysfs(chip);

for (i = 0; i < old_chip->num_leds; i++) {
led_classdev_unregister(&old_chip->leds[i].cdev);
--
1.7.9.5


Best Regards,
Milo


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/