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>
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index faab449..74dc208 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -689,26 +689,6 @@
&lp5521_led_attribute_group);
}
-static void lp5521_deinit_device(struct lp5521_chip *chip);
-static int lp5521_init_device(struct lp5521_chip *chip)
-{
- struct i2c_client *client = chip->client;
- struct lp55xx_chip *temp;
- int ret;
-
- ret = lp5521_post_init_device(temp);
- if (ret < 0) {
- dev_err(&client->dev, "error configuring chip\n");
- goto err_config;
- }
-
- return 0;
-
-err_config:
- lp5521_deinit_device(chip);
- return ret;
-}
-
static void lp5521_deinit_device(struct lp5521_chip *chip)
{
struct lp5521_platform_data *pdata = chip->pdata;
@@ -860,7 +840,7 @@
i2c_set_clientdata(client, led);
- ret = lp5521_init_device(old_chip);
+ ret = lp55xx_init_device(chip);
if (ret)
goto err_init;