diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/video/vfb.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[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>
Diffstat (limited to 'drivers/video/vfb.c')
-rw-r--r-- | drivers/video/vfb.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 8794dc5d246..ffa1ad47422 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c @@ -403,9 +403,8 @@ static void vfb_platform_release(struct device *device) // This is called when the reference count goes to zero. } -static int __init vfb_probe(struct device *device) +static int __init vfb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct fb_info *info; int retval = -ENOMEM; @@ -447,7 +446,7 @@ static int __init vfb_probe(struct device *device) retval = register_framebuffer(info); if (retval < 0) goto err2; - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); printk(KERN_INFO "fb%d: Virtual frame buffer device, using %ldK of video memory\n", @@ -462,9 +461,9 @@ err: return retval; } -static int vfb_remove(struct device *device) +static int vfb_remove(struct platform_device *dev) { - struct fb_info *info = dev_get_drvdata(device); + struct fb_info *info = platform_get_drvdata(dev); if (info) { unregister_framebuffer(info); @@ -474,11 +473,12 @@ static int vfb_remove(struct device *device) return 0; } -static struct device_driver vfb_driver = { - .name = "vfb", - .bus = &platform_bus_type, +static struct platform_driver vfb_driver = { .probe = vfb_probe, .remove = vfb_remove, + .driver = { + .name = "vfb", + }, }; static struct platform_device vfb_device = { @@ -504,12 +504,12 @@ static int __init vfb_init(void) if (!vfb_enable) return -ENXIO; - ret = driver_register(&vfb_driver); + ret = platform_driver_register(&vfb_driver); if (!ret) { ret = platform_device_register(&vfb_device); if (ret) - driver_unregister(&vfb_driver); + platform_driver_unregister(&vfb_driver); } return ret; } @@ -520,7 +520,7 @@ module_init(vfb_init); static void __exit vfb_exit(void) { platform_device_unregister(&vfb_device); - driver_unregister(&vfb_driver); + platform_driver_unregister(&vfb_driver); } module_exit(vfb_exit); |