diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2006-06-26 03:26:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:29 -0400 |
commit | 103edf024b98ff6a1feef9c43886f39b00c5753d (patch) | |
tree | 14abaa9b44a47fd013c10f067d20dd165c0198ca /drivers/video | |
parent | 673681c1b575a73159606ae3c4498de851596489 (diff) |
[PATCH] vesafb: Update platform code
Update platform code to dynamically allocate the platform device
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/vesafb.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index b0b9acfdd43..2fbaa8484f8 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 | ||
463 | static struct platform_device vesafb_device = { | 463 | static struct platform_device *vesafb_device; |
464 | .name = "vesafb", | ||
465 | }; | ||
466 | 464 | ||
467 | static int __init vesafb_init(void) | 465 | static 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 | } |
484 | module_init(vesafb_init); | 491 | module_init(vesafb_init); |