Skip to content

Commit

Permalink
fbdev: da8xx-fb: Fix error handling in .remove()
Browse files Browse the repository at this point in the history
Even in the presence of problems (here: regulator_disable() might fail),
it's important to unregister all resources acquired during .probe() and
disable the device (i.e. DMA activity) because even if .remove() returns
an error code, the device is removed and the .remove() callback is never
called again later to catch up.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 611097d ("fbdev: da8xx: add support for a regulator")
  • Loading branch information
Uwe Kleine-König authored and Helge Deller committed Oct 18, 2022
1 parent 25b72d5 commit 3c6174f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/fbdev/da8xx-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,8 @@ static int fb_remove(struct platform_device *dev)
if (par->lcd_supply) {
ret = regulator_disable(par->lcd_supply);
if (ret)
return ret;
dev_warn(&dev->dev, "Failed to disable regulator (%pe)\n",
ERR_PTR(ret));
}

lcd_disable_raster(DA8XX_FRAME_WAIT);
Expand Down

0 comments on commit 3c6174f

Please sign in to comment.