diff options
Diffstat (limited to 'drivers/video/vesafb.c')
-rw-r--r-- | drivers/video/vesafb.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index ef4128c8e57a..0cadf7aee27e 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/slab.h> | ||
17 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
18 | #include <linux/fb.h> | 17 | #include <linux/fb.h> |
19 | #include <linux/ioport.h> | 18 | #include <linux/ioport.h> |
@@ -226,7 +225,7 @@ static int __init vesafb_setup(char *options) | |||
226 | return 0; | 225 | return 0; |
227 | } | 226 | } |
228 | 227 | ||
229 | static int __devinit vesafb_probe(struct platform_device *dev) | 228 | static int __init vesafb_probe(struct platform_device *dev) |
230 | { | 229 | { |
231 | struct fb_info *info; | 230 | struct fb_info *info; |
232 | int i, err; | 231 | int i, err; |
@@ -477,7 +476,6 @@ err: | |||
477 | } | 476 | } |
478 | 477 | ||
479 | static struct platform_driver vesafb_driver = { | 478 | static struct platform_driver vesafb_driver = { |
480 | .probe = vesafb_probe, | ||
481 | .driver = { | 479 | .driver = { |
482 | .name = "vesafb", | 480 | .name = "vesafb", |
483 | }, | 481 | }, |
@@ -493,20 +491,21 @@ static int __init vesafb_init(void) | |||
493 | /* ignore error return of fb_get_options */ | 491 | /* ignore error return of fb_get_options */ |
494 | fb_get_options("vesafb", &option); | 492 | fb_get_options("vesafb", &option); |
495 | vesafb_setup(option); | 493 | vesafb_setup(option); |
496 | ret = platform_driver_register(&vesafb_driver); | ||
497 | 494 | ||
498 | if (!ret) { | 495 | vesafb_device = platform_device_alloc("vesafb", 0); |
499 | vesafb_device = platform_device_alloc("vesafb", 0); | 496 | if (!vesafb_device) |
497 | return -ENOMEM; | ||
500 | 498 | ||
501 | if (vesafb_device) | 499 | ret = platform_device_add(vesafb_device); |
502 | ret = platform_device_add(vesafb_device); | 500 | if (!ret) { |
503 | else | 501 | ret = platform_driver_probe(&vesafb_driver, vesafb_probe); |
504 | ret = -ENOMEM; | 502 | if (ret) |
503 | platform_device_del(vesafb_device); | ||
504 | } | ||
505 | 505 | ||
506 | if (ret) { | 506 | if (ret) { |
507 | platform_device_put(vesafb_device); | 507 | platform_device_put(vesafb_device); |
508 | platform_driver_unregister(&vesafb_driver); | 508 | vesafb_device = NULL; |
509 | } | ||
510 | } | 509 | } |
511 | 510 | ||
512 | return ret; | 511 | return ret; |