aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/vesafb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/vesafb.c')
-rw-r--r--drivers/video/vesafb.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index b0b9acfdd430..2fbaa8484f8a 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -460,9 +460,7 @@ static struct platform_driver vesafb_driver = {
460 }, 460 },
461}; 461};
462 462
463static struct platform_device vesafb_device = { 463static struct platform_device *vesafb_device;
464 .name = "vesafb",
465};
466 464
467static int __init vesafb_init(void) 465static int __init vesafb_init(void)
468{ 466{
@@ -475,10 +473,19 @@ static int __init vesafb_init(void)
475 ret = platform_driver_register(&vesafb_driver); 473 ret = platform_driver_register(&vesafb_driver);
476 474
477 if (!ret) { 475 if (!ret) {
478 ret = platform_device_register(&vesafb_device); 476 vesafb_device = platform_device_alloc("vesafb", 0);
479 if (ret) 477
478 if (vesafb_device)
479 ret = platform_device_add(vesafb_device);
480 else
481 ret = -ENOMEM;
482
483 if (ret) {
484 platform_device_put(vesafb_device);
480 platform_driver_unregister(&vesafb_driver); 485 platform_driver_unregister(&vesafb_driver);
486 }
481 } 487 }
488
482 return ret; 489 return ret;
483} 490}
484module_init(vesafb_init); 491module_init(vesafb_init);