All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kim, Milo" <Milo.Kim@ti.com>
To: Bryan Wu <bryan.wu@canonical.com>
Cc: Richard Purdie <rpurdie@rpsys.net>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 19/28] leds-lp5521/5523: use lp55xx common deinit device function
Date: Fri, 5 Oct 2012 08:22:02 +0000	[thread overview]
Message-ID: <A874F61F95741C4A9BA573A70FE3998F64176806@DQHE02.ent.ti.com> (raw)

 Use lp55xx common function to release the device.
 Unnecessary old code lines are removed.

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

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 8aa4a90..67d492c 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -528,7 +528,6 @@ err_init:
 
 static int __devexit lp5521_remove(struct i2c_client *client)
 {
-	struct lp5521_chip *old_chip = i2c_get_clientdata(client);
 	struct lp55xx_led *led = i2c_get_clientdata(client);
 	struct lp55xx_chip *chip = led->chip;
 
@@ -536,11 +535,8 @@ static int __devexit lp5521_remove(struct i2c_client *client)
 
 	lp55xx_unregister_sysfs(chip);
 	lp55xx_unregister_leds(led, chip);
+	lp55xx_deinit_device(chip);
 
-	if (old_chip->pdata->enable)
-		old_chip->pdata->enable(0);
-	if (old_chip->pdata->release_resources)
-		old_chip->pdata->release_resources();
 	return 0;
 }
 
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index b029a09..5c4f6df 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -583,7 +583,6 @@ err_init:
 
 static int lp5523_remove(struct i2c_client *client)
 {
-	struct lp5523_chip *old_chip = i2c_get_clientdata(client);
 	struct lp55xx_led *led = i2c_get_clientdata(client);
 	struct lp55xx_chip *chip = led->chip;
 
@@ -591,11 +590,8 @@ static int lp5523_remove(struct i2c_client *client)
 
 	lp55xx_unregister_sysfs(chip);
 	lp55xx_unregister_leds(led, chip);
+	lp55xx_deinit_device(chip);
 
-	if (old_chip->pdata->enable)
-		old_chip->pdata->enable(0);
-	if (old_chip->pdata->release_resources)
-		old_chip->pdata->release_resources();
 	return 0;
 }
 
-- 
1.7.9.5


Best Regards,
Milo



                 reply	other threads:[~2012-10-05  8:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A874F61F95741C4A9BA573A70FE3998F64176806@DQHE02.ent.ti.com \
    --to=milo.kim@ti.com \
    --cc=bryan.wu@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.