All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 17/28] leds-lp5521/5523: use lp55xx common unregister sysfs function
@ 2012-10-05  8:20 Kim, Milo
  0 siblings, 0 replies; only message in thread
From: Kim, Milo @ 2012-10-05  8:20 UTC (permalink / raw)
  To: Bryan Wu; +Cc: Richard Purdie, linux-leds, linux-kernel

 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@ti.com>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-05  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-05  8:20 [PATCH 17/28] leds-lp5521/5523: use lp55xx common unregister sysfs function Kim, Milo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.