Skip to content

Commit cd53860

Browse files
mudonglianghdeller
authored andcommitted
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: 611097d("fbdev: da8xx: add support for a regulator") Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent ff61582 commit cd53860

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/video/fbdev/da8xx-fb.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ static int fb_probe(struct platform_device *device)
14311431
dev_err(&device->dev,
14321432
"GLCD: kmalloc for frame buffer failed\n");
14331433
ret = -EINVAL;
1434-
goto err_release_fb;
1434+
goto err_disable_reg;
14351435
}
14361436

14371437
da8xx_fb_info->screen_base = (char __iomem *) par->vram_virt;
@@ -1475,7 +1475,7 @@ static int fb_probe(struct platform_device *device)
14751475

14761476
ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0);
14771477
if (ret)
1478-
goto err_release_fb;
1478+
goto err_disable_reg;
14791479
da8xx_fb_info->cmap.len = par->palette_sz;
14801480

14811481
/* initialize var_screeninfo */
@@ -1529,6 +1529,9 @@ static int fb_probe(struct platform_device *device)
15291529
err_dealloc_cmap:
15301530
fb_dealloc_cmap(&da8xx_fb_info->cmap);
15311531

1532+
err_disable_reg:
1533+
if (par->lcd_supply)
1534+
regulator_disable(par->lcd_supply);
15321535
err_release_fb:
15331536
framebuffer_release(da8xx_fb_info);
15341537

0 commit comments

Comments
 (0)