aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/exynos
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-02-21 19:42:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:18 -0500
commita25fc871b002c51944c05b9a09f1526dfbe32d39 (patch)
tree00508d9395dfe67be7bd785c09061ce362957d2c /drivers/video/exynos
parentd04d2681dde1f843719ce6ae5f920933d708ab27 (diff)
drivers/video/exynos/s6e8ax0.c: use devm_* APIs in s6e8ax0.c
devm_* APIs are device managed and make error handling and code cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Donghwa Lee <dh09.lee@samsung.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/exynos')
-rw-r--r--drivers/video/exynos/s6e8ax0.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c
index 05d080b63bc0..ca2602413aa4 100644
--- a/drivers/video/exynos/s6e8ax0.c
+++ b/drivers/video/exynos/s6e8ax0.c
@@ -776,7 +776,7 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev)
776 int ret; 776 int ret;
777 u8 mtp_id[3] = {0, }; 777 u8 mtp_id[3] = {0, };
778 778
779 lcd = kzalloc(sizeof(struct s6e8ax0), GFP_KERNEL); 779 lcd = devm_kzalloc(&dsim_dev->dev, sizeof(struct s6e8ax0), GFP_KERNEL);
780 if (!lcd) { 780 if (!lcd) {
781 dev_err(&dsim_dev->dev, "failed to allocate s6e8ax0 structure.\n"); 781 dev_err(&dsim_dev->dev, "failed to allocate s6e8ax0 structure.\n");
782 return -ENOMEM; 782 return -ENOMEM;
@@ -788,18 +788,17 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev)
788 788
789 mutex_init(&lcd->lock); 789 mutex_init(&lcd->lock);
790 790
791 ret = regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); 791 ret = devm_regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies);
792 if (ret) { 792 if (ret) {
793 dev_err(lcd->dev, "Failed to get regulators: %d\n", ret); 793 dev_err(lcd->dev, "Failed to get regulators: %d\n", ret);
794 goto err_lcd_register; 794 return ret;
795 } 795 }
796 796
797 lcd->ld = lcd_device_register("s6e8ax0", lcd->dev, lcd, 797 lcd->ld = lcd_device_register("s6e8ax0", lcd->dev, lcd,
798 &s6e8ax0_lcd_ops); 798 &s6e8ax0_lcd_ops);
799 if (IS_ERR(lcd->ld)) { 799 if (IS_ERR(lcd->ld)) {
800 dev_err(lcd->dev, "failed to register lcd ops.\n"); 800 dev_err(lcd->dev, "failed to register lcd ops.\n");
801 ret = PTR_ERR(lcd->ld); 801 return PTR_ERR(lcd->ld);
802 goto err_lcd_register;
803 } 802 }
804 803
805 lcd->bd = backlight_device_register("s6e8ax0-bl", lcd->dev, lcd, 804 lcd->bd = backlight_device_register("s6e8ax0-bl", lcd->dev, lcd,
@@ -838,11 +837,6 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev)
838 837
839err_backlight_register: 838err_backlight_register:
840 lcd_device_unregister(lcd->ld); 839 lcd_device_unregister(lcd->ld);
841
842err_lcd_register:
843 regulator_bulk_free(ARRAY_SIZE(supplies), supplies);
844 kfree(lcd);
845
846 return ret; 840 return ret;
847} 841}
848 842