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>
This commit is contained in:

committed by
Bryan Wu

parent
ffbdccdbba
commit
22ebeb488b
@@ -144,9 +144,18 @@ int lp55xx_init_device(struct lp55xx_chip *chip)
|
||||
|
||||
/* chip specific initialization */
|
||||
ret = lp55xx_post_init_device(chip);
|
||||
if (ret) {
|
||||
dev_err(dev, "post init device err: %d\n", ret);
|
||||
goto err_post_init;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_post_init:
|
||||
if (pdata->enable)
|
||||
pdata->enable(0);
|
||||
if (pdata->release_resources)
|
||||
pdata->release_resources();
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user