Skip to content

Commit

Permalink
efifb: Disallow manual bind and unbind
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Lutomirski authored and Paul Mundt committed Jun 2, 2011
1 parent da0241f commit bb8b266
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions drivers/video/efifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static int __init efifb_setup(char *options)
return 0;
}

static int __devinit efifb_probe(struct platform_device *dev)
static int __init efifb_probe(struct platform_device *dev)
{
struct fb_info *info;
int err;
Expand Down Expand Up @@ -500,7 +500,6 @@ static int __devinit efifb_probe(struct platform_device *dev)
}

static struct platform_driver efifb_driver = {
.probe = efifb_probe,
.driver = {
.name = "efifb",
},
Expand Down Expand Up @@ -531,13 +530,21 @@ static int __init efifb_init(void)
if (!screen_info.lfb_linelength)
return -ENODEV;

ret = platform_driver_register(&efifb_driver);
ret = platform_device_register(&efifb_device);
if (ret)
return ret;

if (!ret) {
ret = platform_device_register(&efifb_device);
if (ret)
platform_driver_unregister(&efifb_driver);
/*
* This is not just an optimization. We will interfere
* with a real driver if we get reprobed, so don't allow
* it.
*/
ret = platform_driver_probe(&efifb_driver, efifb_probe);
if (ret) {
platform_device_unregister(&efifb_driver);
return ret;
}

return ret;
}
module_init(efifb_init);
Expand Down

0 comments on commit bb8b266

Please sign in to comment.