diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-02-21 19:43:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:24 -0500 |
commit | a5f822114c08c381b14d7c60e237685d75012c22 (patch) | |
tree | 2673cf8bbba5620268dec66001a2a9d9ba8e5695 /drivers/video | |
parent | 610b71a6526f71aff9e1bc77065e8393c80779b0 (diff) |
drivers/video/backlight/ld9040.c: use devm_regulator_bulk_get() API
devm_regulator_bulk_get is device managed and saves some cleanup
and exit code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/ld9040.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index 24f2c9aa10f1..1b642f5f381a 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c | |||
@@ -710,17 +710,15 @@ static int ld9040_probe(struct spi_device *spi) | |||
710 | 710 | ||
711 | mutex_init(&lcd->lock); | 711 | mutex_init(&lcd->lock); |
712 | 712 | ||
713 | ret = regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); | 713 | ret = devm_regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); |
714 | if (ret) { | 714 | if (ret) { |
715 | dev_err(lcd->dev, "Failed to get regulators: %d\n", ret); | 715 | dev_err(lcd->dev, "Failed to get regulators: %d\n", ret); |
716 | return ret; | 716 | return ret; |
717 | } | 717 | } |
718 | 718 | ||
719 | ld = lcd_device_register("ld9040", &spi->dev, lcd, &ld9040_lcd_ops); | 719 | ld = lcd_device_register("ld9040", &spi->dev, lcd, &ld9040_lcd_ops); |
720 | if (IS_ERR(ld)) { | 720 | if (IS_ERR(ld)) |
721 | ret = PTR_ERR(ld); | 721 | return PTR_ERR(ld); |
722 | goto out_free_regulator; | ||
723 | } | ||
724 | 722 | ||
725 | lcd->ld = ld; | 723 | lcd->ld = ld; |
726 | 724 | ||
@@ -762,8 +760,6 @@ static int ld9040_probe(struct spi_device *spi) | |||
762 | 760 | ||
763 | out_unregister_lcd: | 761 | out_unregister_lcd: |
764 | lcd_device_unregister(lcd->ld); | 762 | lcd_device_unregister(lcd->ld); |
765 | out_free_regulator: | ||
766 | regulator_bulk_free(ARRAY_SIZE(supplies), supplies); | ||
767 | 763 | ||
768 | return ret; | 764 | return ret; |
769 | } | 765 | } |
@@ -775,7 +771,6 @@ static int ld9040_remove(struct spi_device *spi) | |||
775 | ld9040_power(lcd, FB_BLANK_POWERDOWN); | 771 | ld9040_power(lcd, FB_BLANK_POWERDOWN); |
776 | backlight_device_unregister(lcd->bd); | 772 | backlight_device_unregister(lcd->bd); |
777 | lcd_device_unregister(lcd->ld); | 773 | lcd_device_unregister(lcd->ld); |
778 | regulator_bulk_free(ARRAY_SIZE(supplies), supplies); | ||
779 | 774 | ||
780 | return 0; | 775 | return 0; |
781 | } | 776 | } |