summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2016-09-07 17:09:19 +0800
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-09-27 11:21:36 +0300
commit7c9806e82588cd9601ab2d30ca3bfb5b8fda2965 (patch)
treeb20e4105b3ffc482049971f4edd1e1bf95e29fa5 /drivers/video
parentca9384c5911199257cbdf48f1bc3e3986de611a2 (diff)
downloadlinux-7c9806e82588cd9601ab2d30ca3bfb5b8fda2965.tar.gz
simplefb: Disable and release clocks and regulators in destroy callback
simplefb gets unregister when a proper framebuffer driver comes in and kicks it out. However the claimed clocks and regulators stay enabled as they are only released in the platform device remove function, which in theory would never get called. Move the clock/regulator cleanup into the framebuffer destroy callback, which gets called as part of the framebuffer unregister process. Note this introduces asymmetry in how the resources are claimed and released. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/simplefb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 85775dfd54b1..61f799a515dc 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -74,8 +74,14 @@ static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
return 0;
}
+struct simplefb_par;
+static void simplefb_clocks_destroy(struct simplefb_par *par);
+static void simplefb_regulators_destroy(struct simplefb_par *par);
+
static void simplefb_destroy(struct fb_info *info)
{
+ simplefb_regulators_destroy(info->par);
+ simplefb_clocks_destroy(info->par);
if (info->screen_base)
iounmap(info->screen_base);
}
@@ -487,11 +493,8 @@ error_fb_release:
static int simplefb_remove(struct platform_device *pdev)
{
struct fb_info *info = platform_get_drvdata(pdev);
- struct simplefb_par *par = info->par;
unregister_framebuffer(info);
- simplefb_regulators_destroy(par);
- simplefb_clocks_destroy(par);
framebuffer_release(info);
return 0;