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-lp55xx-common.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-lp55xx-common.c')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index c06745f160c3..bcabf2cb949a 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -152,14 +152,23 @@ int lp55xx_init_device(struct lp55xx_chip *chip) return 0; err_post_init: + lp55xx_deinit_device(chip); +err: + return ret; +} +EXPORT_SYMBOL_GPL(lp55xx_init_device); + +void lp55xx_deinit_device(struct lp55xx_chip *chip) +{ + struct lp55xx_platform_data *pdata = chip->pdata; + if (pdata->enable) pdata->enable(0); + if (pdata->release_resources) pdata->release_resources(); -err: - return ret; } -EXPORT_SYMBOL_GPL(lp55xx_init_device); +EXPORT_SYMBOL_GPL(lp55xx_deinit_device); MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>"); MODULE_DESCRIPTION("LP55xx Common Driver"); |