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/sgivwfb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/video/sgivwfb.c') diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index 2e8769dd345a..7054660767e4 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c @@ -750,9 +750,8 @@ int __init sgivwfb_setup(char *options) /* * Initialisation */ -static int __init sgivwfb_probe(struct device *device) +static int __init sgivwfb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct sgivw_par *par; struct fb_info *info; char *monitor; @@ -813,7 +812,7 @@ static int __init sgivwfb_probe(struct device *device) goto fail_register_framebuffer; } - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); @@ -831,9 +830,9 @@ fail_ioremap_regs: return -ENXIO; } -static int sgivwfb_remove(struct device *device) +static int sgivwfb_remove(struct platform_device *dev) { - struct fb_info *info = dev_get_drvdata(device); + struct fb_info *info = platform_get_drvdata(dev); if (info) { struct sgivw_par *par = info->par; @@ -847,11 +846,12 @@ static int sgivwfb_remove(struct device *device) return 0; } -static struct device_driver sgivwfb_driver = { - .name = "sgivwfb", - .bus = &platform_bus_type, +static struct platform_driver sgivwfb_driver = { .probe = sgivwfb_probe, .remove = sgivwfb_remove, + .driver = { + .name = "sgivwfb", + }, }; static struct platform_device *sgivwfb_device; @@ -867,7 +867,7 @@ int __init sgivwfb_init(void) return -ENODEV; sgivwfb_setup(option); #endif - ret = driver_register(&sgivwfb_driver); + ret = platform_driver_register(&sgivwfb_driver); if (!ret) { sgivwfb_device = platform_device_alloc("sgivwfb", 0); if (sgivwfb_device) { @@ -875,7 +875,7 @@ int __init sgivwfb_init(void) } else ret = -ENOMEM; if (ret) { - driver_unregister(&sgivwfb_driver); + platform_driver_unregister(&sgivwfb_driver); platform_device_put(sgivwfb_device); } } @@ -890,7 +890,7 @@ MODULE_LICENSE("GPL"); static void __exit sgivwfb_exit(void) { platform_device_unregister(sgivwfb_device); - driver_unregister(&sgivwfb_driver); + platform_driver_unregister(&sgivwfb_driver); } module_exit(sgivwfb_exit); -- cgit v1.2.3