Commit 7c9806e8 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Tomi Valkeinen

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: default avatarChen-Yu Tsai <wens@csie.org>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent ca9384c5
......@@ -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 @@ static int simplefb_probe(struct platform_device *pdev)
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;
......
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