aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-01-23 09:14:55 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-03-07 08:30:49 -0500
commit65b4021ed67622b675b431fc2f3633b2af8cea6d (patch)
tree41f4fa29dc884d0d39c185b715f93ec61873530a /drivers/video
parenta9b47c7f23908bf2a5536040c46624178ba5f5c0 (diff)
fbdev: efifb: add dev->remove() callback
If x86-sysfb platform-devices are removed from a system, we should properly unload efifb. Otherwise, we end up releasing the parent while our efi framebuffer is still running. This currently works just fine, but will cause problems on handover to real hw. So add the ->remove() callback and unregister efifb. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/efifb.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index cd7c0df9f24b..ae9618ff6735 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -73,7 +73,6 @@ static void efifb_destroy(struct fb_info *info)
73 release_mem_region(info->apertures->ranges[0].base, 73 release_mem_region(info->apertures->ranges[0].base,
74 info->apertures->ranges[0].size); 74 info->apertures->ranges[0].size);
75 fb_dealloc_cmap(&info->cmap); 75 fb_dealloc_cmap(&info->cmap);
76 framebuffer_release(info);
77} 76}
78 77
79static struct fb_ops efifb_ops = { 78static struct fb_ops efifb_ops = {
@@ -244,6 +243,7 @@ static int efifb_probe(struct platform_device *dev)
244 err = -ENOMEM; 243 err = -ENOMEM;
245 goto err_release_mem; 244 goto err_release_mem;
246 } 245 }
246 platform_set_drvdata(dev, info);
247 info->pseudo_palette = info->par; 247 info->pseudo_palette = info->par;
248 info->par = NULL; 248 info->par = NULL;
249 249
@@ -337,12 +337,23 @@ err_release_mem:
337 return err; 337 return err;
338} 338}
339 339
340static int efifb_remove(struct platform_device *pdev)
341{
342 struct fb_info *info = platform_get_drvdata(pdev);
343
344 unregister_framebuffer(info);
345 framebuffer_release(info);
346
347 return 0;
348}
349
340static struct platform_driver efifb_driver = { 350static struct platform_driver efifb_driver = {
341 .driver = { 351 .driver = {
342 .name = "efi-framebuffer", 352 .name = "efi-framebuffer",
343 .owner = THIS_MODULE, 353 .owner = THIS_MODULE,
344 }, 354 },
345 .probe = efifb_probe, 355 .probe = efifb_probe,
356 .remove = efifb_remove,
346}; 357};
347 358
348module_platform_driver(efifb_driver); 359module_platform_driver(efifb_driver);