aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@MIT.EDU>2011-05-26 10:13:34 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-06-02 04:18:07 -0400
commitbb8b26627267a82c49f47fc52a0785f079a7b063 (patch)
treebb1559a35d5417a6dd08790b50ba8a99bdc90f68 /drivers/video
parentda0241f12bf785f74e57ad6d67abdf269216f76b (diff)
efifb: Disallow manual bind and unbind
Both were buggy: bind would happily scribble over a real graphics device and unbind wouldn't destroy the framebuffer. Hotplugging efifb makes no sense anyway, so just disable it. As an added benefit, we save some runtime memory. Signed-off-by: Andy Lutomirski <luto@mit.edu> Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/efifb.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 8cb31e106b9e..69c49dfce9cf 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -330,7 +330,7 @@ static int __init efifb_setup(char *options)
330 return 0; 330 return 0;
331} 331}
332 332
333static int __devinit efifb_probe(struct platform_device *dev) 333static int __init efifb_probe(struct platform_device *dev)
334{ 334{
335 struct fb_info *info; 335 struct fb_info *info;
336 int err; 336 int err;
@@ -500,7 +500,6 @@ err_release_mem:
500} 500}
501 501
502static struct platform_driver efifb_driver = { 502static struct platform_driver efifb_driver = {
503 .probe = efifb_probe,
504 .driver = { 503 .driver = {
505 .name = "efifb", 504 .name = "efifb",
506 }, 505 },
@@ -531,13 +530,21 @@ static int __init efifb_init(void)
531 if (!screen_info.lfb_linelength) 530 if (!screen_info.lfb_linelength)
532 return -ENODEV; 531 return -ENODEV;
533 532
534 ret = platform_driver_register(&efifb_driver); 533 ret = platform_device_register(&efifb_device);
534 if (ret)
535 return ret;
535 536
536 if (!ret) { 537 /*
537 ret = platform_device_register(&efifb_device); 538 * This is not just an optimization. We will interfere
538 if (ret) 539 * with a real driver if we get reprobed, so don't allow
539 platform_driver_unregister(&efifb_driver); 540 * it.
541 */
542 ret = platform_driver_probe(&efifb_driver, efifb_probe);
543 if (ret) {
544 platform_device_unregister(&efifb_driver);
545 return ret;
540 } 546 }
547
541 return ret; 548 return ret;
542} 549}
543module_init(efifb_init); 550module_init(efifb_init);