aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp55xx-common.c
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 04:58:35 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-06 18:59:27 -0500
commit22ebeb488b3dbbb64b81146b366551107ae34af8 (patch)
tree74eef8d5dcbc48c39b5452560bda094a0e8718ea /drivers/leds/leds-lp55xx-common.c
parentffbdccdbbaee814963a09d25b1cc598cfe131366 (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-lp55xx-common.c')
-rw-r--r--drivers/leds/leds-lp55xx-common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 74beb363b787..c06745f160c3 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -144,9 +144,18 @@ int lp55xx_init_device(struct lp55xx_chip *chip)
144 144
145 /* chip specific initialization */ 145 /* chip specific initialization */
146 ret = lp55xx_post_init_device(chip); 146 ret = lp55xx_post_init_device(chip);
147 if (ret) {
148 dev_err(dev, "post init device err: %d\n", ret);
149 goto err_post_init;
150 }
147 151
148 return 0; 152 return 0;
149 153
154err_post_init:
155 if (pdata->enable)
156 pdata->enable(0);
157 if (pdata->release_resources)
158 pdata->release_resources();
150err: 159err:
151 return ret; 160 return ret;
152} 161}