[DRIVER MODEL] Convert platform drivers to use struct platform_driver

This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Russell King
2005-11-09 22:32:44 +00:00
committed by Russell King
parent 00d3dcdd96
commit 3ae5eaec1d
93 changed files with 1413 additions and 1416 deletions

View File

@@ -245,9 +245,8 @@ static int __init vesafb_setup(char *options)
return 0;
}
static int __init vesafb_probe(struct device *device)
static int __init vesafb_probe(struct platform_device *dev)
{
struct platform_device *dev = to_platform_device(device);
struct fb_info *info;
int i, err;
unsigned int size_vmode;
@@ -480,10 +479,11 @@ err:
return err;
}
static struct device_driver vesafb_driver = {
.name = "vesafb",
.bus = &platform_bus_type,
static struct platform_driver vesafb_driver = {
.probe = vesafb_probe,
.driver = {
.name = "vesafb",
},
};
static struct platform_device vesafb_device = {
@@ -498,12 +498,12 @@ static int __init vesafb_init(void)
/* ignore error return of fb_get_options */
fb_get_options("vesafb", &option);
vesafb_setup(option);
ret = driver_register(&vesafb_driver);
ret = platform_driver_register(&vesafb_driver);
if (!ret) {
ret = platform_device_register(&vesafb_device);
if (ret)
driver_unregister(&vesafb_driver);
platform_driver_unregister(&vesafb_driver);
}
return ret;
}