From 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 9 Nov 2005 22:32:44 +0000 Subject: [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 Acked-by: Greg Kroah-Hartman --- drivers/video/q40fb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/video/q40fb.c') diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c index bfc41f2c902a..fc91dbf896d2 100644 --- a/drivers/video/q40fb.c +++ b/drivers/video/q40fb.c @@ -86,9 +86,8 @@ static struct fb_ops q40fb_ops = { .fb_imageblit = cfb_imageblit, }; -static int __init q40fb_probe(struct device *device) +static int __init q40fb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct fb_info *info; if (!MACH_IS_Q40) @@ -128,10 +127,11 @@ static int __init q40fb_probe(struct device *device) return 0; } -static struct device_driver q40fb_driver = { - .name = "q40fb", - .bus = &platform_bus_type, +static struct platform_driver q40fb_driver = { .probe = q40fb_probe, + .driver = { + .name = "q40fb", + }, }; static struct platform_device q40fb_device = { @@ -145,12 +145,12 @@ int __init q40fb_init(void) if (fb_get_options("q40fb", NULL)) return -ENODEV; - ret = driver_register(&q40fb_driver); + ret = platform_driver_register(&q40fb_driver); if (!ret) { ret = platform_device_register(&q40fb_device); if (ret) - driver_unregister(&q40fb_driver); + platform_driver_unregister(&q40fb_driver); } return ret; } -- cgit v1.2.3