summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5523.c
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 19:23:51 +0900
committerBryan Wu <cooloney@gmail.com>2013-02-06 15:59:29 -0800
commit87cc4bde2a97cd8acccf34f333d0980dc5c2aa8a (patch)
tree6f9af11557a3828f5a7795685a0ce55ada594c46 /drivers/leds/leds-lp5523.c
parentba6fa84651ff9a609e0ceb8265e3335ab6ed656d (diff)
downloadop-kernel-dev-87cc4bde2a97cd8acccf34f333d0980dc5c2aa8a.zip
op-kernel-dev-87cc4bde2a97cd8acccf34f333d0980dc5c2aa8a.tar.gz
leds-lp55xx: clean up _remove()
Replace lp5521/5523_unregister_sysfs() with lp55xx_unregister_sysfs(). On unloading the driver, running engines should be stopped. Use explicit driver function, lp5521/5523_stop_engine(). Unused functions are removed. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-lp5523.c')
-rw-r--r--drivers/leds/leds-lp5523.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 5770599..cf587c1 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -173,11 +173,6 @@ static void lp5523_set_led_current(struct lp55xx_led *led, u8 led_current)
led_current);
}
-static int lp5523_write(struct i2c_client *client, u8 reg, u8 value)
-{
- return i2c_smbus_write_byte_data(client, reg, value);
-}
-
static int lp5523_post_init_device(struct lp55xx_chip *chip)
{
int ret;
@@ -471,13 +466,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);
-}
-
/* Chip specific configurations */
static struct lp55xx_device_config lp5523_cfg = {
.reset = {
@@ -558,11 +546,8 @@ static int lp5523_remove(struct i2c_client *client)
struct lp55xx_led *led = i2c_get_clientdata(client);
struct lp55xx_chip *chip = led->chip;
- /* Disable engine mode */
- lp5523_write(client, LP5523_REG_OP_MODE, LP5523_CMD_DISABLED);
-
- lp5523_unregister_sysfs(client);
-
+ lp5523_stop_engine(chip);
+ lp55xx_unregister_sysfs(chip);
lp55xx_unregister_leds(led, chip);
lp55xx_deinit_device(chip);
OpenPOWER on IntegriCloud