diff options
author | Jan Beulich <JBeulich@novell.com> | 2010-04-06 17:34:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-07 11:38:02 -0400 |
commit | fc95c6d9b4433525ed9484089b6e092f3516a92b (patch) | |
tree | fa98b2e6238c73a6ebdbb59b0fb8107dfc0369fe | |
parent | 530cd330dc3865e3107304a6e84fdc332aa72f7d (diff) |
vesafb: use platform_driver_probe() instead of platform_driver_register()
Commit c2e13037e6794bd0d9de3f9ecabf5615f15c160b ("platform-drivers: move
probe to .devinit.text in drivers/video") introduced a huge amount of
section mismatch warnings in vesafb code. Rather than converting all of
the annotations, do the obvious and revert the __init -> __devinit change,
and use the recommended (in that patch) alternative to calling
platform_driver_register(): vesafb depends on information obtained from by
kernel at boot time, cannot be a module, and no post-boot devices can ever
show up.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/vesafb.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index 54ac91dc070b..0cadf7aee27e 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c | |||
@@ -225,7 +225,7 @@ static int __init vesafb_setup(char *options) | |||
225 | return 0; | 225 | return 0; |
226 | } | 226 | } |
227 | 227 | ||
228 | static int __devinit vesafb_probe(struct platform_device *dev) | 228 | static int __init vesafb_probe(struct platform_device *dev) |
229 | { | 229 | { |
230 | struct fb_info *info; | 230 | struct fb_info *info; |
231 | int i, err; | 231 | int i, err; |
@@ -476,7 +476,6 @@ err: | |||
476 | } | 476 | } |
477 | 477 | ||
478 | static struct platform_driver vesafb_driver = { | 478 | static struct platform_driver vesafb_driver = { |
479 | .probe = vesafb_probe, | ||
480 | .driver = { | 479 | .driver = { |
481 | .name = "vesafb", | 480 | .name = "vesafb", |
482 | }, | 481 | }, |
@@ -492,20 +491,21 @@ static int __init vesafb_init(void) | |||
492 | /* ignore error return of fb_get_options */ | 491 | /* ignore error return of fb_get_options */ |
493 | fb_get_options("vesafb", &option); | 492 | fb_get_options("vesafb", &option); |
494 | vesafb_setup(option); | 493 | vesafb_setup(option); |
495 | ret = platform_driver_register(&vesafb_driver); | ||
496 | 494 | ||
497 | if (!ret) { | 495 | vesafb_device = platform_device_alloc("vesafb", 0); |
498 | vesafb_device = platform_device_alloc("vesafb", 0); | 496 | if (!vesafb_device) |
497 | return -ENOMEM; | ||
499 | 498 | ||
500 | if (vesafb_device) | 499 | ret = platform_device_add(vesafb_device); |
501 | ret = platform_device_add(vesafb_device); | 500 | if (!ret) { |
502 | else | 501 | ret = platform_driver_probe(&vesafb_driver, vesafb_probe); |
503 | ret = -ENOMEM; | 502 | if (ret) |
503 | platform_device_del(vesafb_device); | ||
504 | } | ||
504 | 505 | ||
505 | if (ret) { | 506 | if (ret) { |
506 | platform_device_put(vesafb_device); | 507 | platform_device_put(vesafb_device); |
507 | platform_driver_unregister(&vesafb_driver); | 508 | vesafb_device = NULL; |
508 | } | ||
509 | } | 509 | } |
510 | 510 | ||
511 | return ret; | 511 | return ret; |