vesafb: use platform_driver_probe() instead of platform_driver_register()

Commit c2e13037e6 ("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>
This commit is contained in:
Jan Beulich 2010-04-06 14:34:44 -07:00 committed by Linus Torvalds
parent 530cd330dc
commit fc95c6d9b4

View File

@ -225,7 +225,7 @@ static int __init vesafb_setup(char *options)
return 0; return 0;
} }
static int __devinit vesafb_probe(struct platform_device *dev) static int __init vesafb_probe(struct platform_device *dev)
{ {
struct fb_info *info; struct fb_info *info;
int i, err; int i, err;
@ -476,7 +476,6 @@ err:
} }
static struct platform_driver vesafb_driver = { static struct platform_driver vesafb_driver = {
.probe = vesafb_probe,
.driver = { .driver = {
.name = "vesafb", .name = "vesafb",
}, },
@ -492,20 +491,21 @@ static int __init vesafb_init(void)
/* ignore error return of fb_get_options */ /* ignore error return of fb_get_options */
fb_get_options("vesafb", &option); fb_get_options("vesafb", &option);
vesafb_setup(option); vesafb_setup(option);
ret = platform_driver_register(&vesafb_driver);
vesafb_device = platform_device_alloc("vesafb", 0);
if (!vesafb_device)
return -ENOMEM;
ret = platform_device_add(vesafb_device);
if (!ret) { if (!ret) {
vesafb_device = platform_device_alloc("vesafb", 0); ret = platform_driver_probe(&vesafb_driver, vesafb_probe);
if (ret)
platform_device_del(vesafb_device);
}
if (vesafb_device) if (ret) {
ret = platform_device_add(vesafb_device); platform_device_put(vesafb_device);
else vesafb_device = NULL;
ret = -ENOMEM;
if (ret) {
platform_device_put(vesafb_device);
platform_driver_unregister(&vesafb_driver);
}
} }
return ret; return ret;