diff options
author | Milo(Woogyom) Kim <milo.kim@ti.com> | 2013-02-05 04:58:35 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-02-06 18:59:27 -0500 |
commit | 22ebeb488b3dbbb64b81146b366551107ae34af8 (patch) | |
tree | 74eef8d5dcbc48c39b5452560bda094a0e8718ea /drivers/leds/leds-lp5521.c | |
parent | ffbdccdbbaee814963a09d25b1cc598cfe131366 (diff) |
leds-lp55xx: clean up init function
lp5521/5523_init_device() are replaced with lp55xx common function,
lp55xx_init_device().
Error handler in init_device:
deinit function are matched with 'err_post_init' section in
lp55xx_init_device().
Remove LP5523 engine intialization code:
Engine functionality is not mandatory but optional.
Moreover engine initialization is done internally with device reset command.
Therefore, this code is unnecessary.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index faab44900c23..74dc208fb99f 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c | |||
@@ -689,26 +689,6 @@ static void lp5521_unregister_sysfs(struct i2c_client *client) | |||
689 | &lp5521_led_attribute_group); | 689 | &lp5521_led_attribute_group); |
690 | } | 690 | } |
691 | 691 | ||
692 | static void lp5521_deinit_device(struct lp5521_chip *chip); | ||
693 | static int lp5521_init_device(struct lp5521_chip *chip) | ||
694 | { | ||
695 | struct i2c_client *client = chip->client; | ||
696 | struct lp55xx_chip *temp; | ||
697 | int ret; | ||
698 | |||
699 | ret = lp5521_post_init_device(temp); | ||
700 | if (ret < 0) { | ||
701 | dev_err(&client->dev, "error configuring chip\n"); | ||
702 | goto err_config; | ||
703 | } | ||
704 | |||
705 | return 0; | ||
706 | |||
707 | err_config: | ||
708 | lp5521_deinit_device(chip); | ||
709 | return ret; | ||
710 | } | ||
711 | |||
712 | static void lp5521_deinit_device(struct lp5521_chip *chip) | 692 | static void lp5521_deinit_device(struct lp5521_chip *chip) |
713 | { | 693 | { |
714 | struct lp5521_platform_data *pdata = chip->pdata; | 694 | struct lp5521_platform_data *pdata = chip->pdata; |
@@ -860,7 +840,7 @@ static int lp5521_probe(struct i2c_client *client, | |||
860 | 840 | ||
861 | i2c_set_clientdata(client, led); | 841 | i2c_set_clientdata(client, led); |
862 | 842 | ||
863 | ret = lp5521_init_device(old_chip); | 843 | ret = lp55xx_init_device(chip); |
864 | if (ret) | 844 | if (ret) |
865 | goto err_init; | 845 | goto err_init; |
866 | 846 | ||