Commit cd53860e authored by Dongliang Mu's avatar Dongliang Mu Committed by Helge Deller

fbdev: da8xx-fb: add missing regulator_disable() in fb_probe

The error handling code in fb_probe misses regulator_disable if
regulator_enable is called successfully. The previous commit only
adds regulator_disable in the .remove(), forgetting the error
handling code in the .probe.

Fix this by adding a new error label to call regulator_disable.

Fixes: 611097d5("fbdev: da8xx: add support for a regulator")
Signed-off-by: default avatarDongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent ff61582e
...@@ -1431,7 +1431,7 @@ static int fb_probe(struct platform_device *device) ...@@ -1431,7 +1431,7 @@ static int fb_probe(struct platform_device *device)
dev_err(&device->dev, dev_err(&device->dev,
"GLCD: kmalloc for frame buffer failed\n"); "GLCD: kmalloc for frame buffer failed\n");
ret = -EINVAL; ret = -EINVAL;
goto err_release_fb; goto err_disable_reg;
} }
da8xx_fb_info->screen_base = (char __iomem *) par->vram_virt; da8xx_fb_info->screen_base = (char __iomem *) par->vram_virt;
...@@ -1475,7 +1475,7 @@ static int fb_probe(struct platform_device *device) ...@@ -1475,7 +1475,7 @@ static int fb_probe(struct platform_device *device)
ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0);
if (ret) if (ret)
goto err_release_fb; goto err_disable_reg;
da8xx_fb_info->cmap.len = par->palette_sz; da8xx_fb_info->cmap.len = par->palette_sz;
/* initialize var_screeninfo */ /* initialize var_screeninfo */
...@@ -1529,6 +1529,9 @@ static int fb_probe(struct platform_device *device) ...@@ -1529,6 +1529,9 @@ static int fb_probe(struct platform_device *device)
err_dealloc_cmap: err_dealloc_cmap:
fb_dealloc_cmap(&da8xx_fb_info->cmap); fb_dealloc_cmap(&da8xx_fb_info->cmap);
err_disable_reg:
if (par->lcd_supply)
regulator_disable(par->lcd_supply);
err_release_fb: err_release_fb:
framebuffer_release(da8xx_fb_info); framebuffer_release(da8xx_fb_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment