diff options
author | Milo(Woogyom) Kim <milo.kim@ti.com> | 2013-02-05 11:03:02 +0100 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-02-07 00:59:27 +0100 |
commit | 6ce6176263393dd80b9a537c1e1462b8529f240b (patch) | |
tree | 9e96351d63c51119625d09d0f3df61376c803367 /drivers/leds/leds-lp5523.c | |
parent | leds-lp55xx: clean up init function (diff) | |
download | linux-6ce6176263393dd80b9a537c1e1462b8529f240b.tar.xz linux-6ce6176263393dd80b9a537c1e1462b8529f240b.zip |
leds-lp55xx: use lp55xx common deinit function
Two separate de-init functions are merged into one common function.
And it is used in err_post_init of lp55xx_init_device().
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.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index 80b7fb4a3ad6..3f506e3d4986 100644 --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -872,16 +872,6 @@ static void lp5523_unregister_leds(struct lp5523_chip *chip) } } -static void lp5523_deinit_device(struct lp5523_chip *chip) -{ - struct lp5523_platform_data *pdata = chip->pdata; - - if (pdata->enable) - pdata->enable(0); - if (pdata->release_resources) - pdata->release_resources(); -} - /* Chip specific configurations */ static struct lp55xx_device_config lp5523_cfg = { .reset = { @@ -944,7 +934,7 @@ static int lp5523_probe(struct i2c_client *client, return ret; fail2: lp5523_unregister_leds(old_chip); - lp5523_deinit_device(old_chip); + lp55xx_deinit_device(chip); err_init: return ret; } @@ -952,6 +942,8 @@ 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; /* Disable engine mode */ lp5523_write(client, LP5523_REG_OP_MODE, LP5523_CMD_DISABLED); @@ -959,8 +951,8 @@ static int lp5523_remove(struct i2c_client *client) lp5523_unregister_sysfs(client); lp5523_unregister_leds(old_chip); + lp55xx_deinit_device(chip); - lp5523_deinit_device(old_chip); return 0; } |