aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/vfb.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/video/vfb.c
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (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.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 8794dc5d2466..ffa1ad474226 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -403,9 +403,8 @@ static void vfb_platform_release(struct device *device)
403 // This is called when the reference count goes to zero. 403 // This is called when the reference count goes to zero.
404} 404}
405 405
406static int __init vfb_probe(struct device *device) 406static int __init vfb_probe(struct platform_device *dev)
407{ 407{
408 struct platform_device *dev = to_platform_device(device);
409 struct fb_info *info; 408 struct fb_info *info;
410 int retval = -ENOMEM; 409 int retval = -ENOMEM;
411 410
@@ -447,7 +446,7 @@ static int __init vfb_probe(struct device *device)
447 retval = register_framebuffer(info); 446 retval = register_framebuffer(info);
448 if (retval < 0) 447 if (retval < 0)
449 goto err2; 448 goto err2;
450 dev_set_drvdata(&dev->dev, info); 449 platform_set_drvdata(dev, info);
451 450
452 printk(KERN_INFO 451 printk(KERN_INFO
453 "fb%d: Virtual frame buffer device, using %ldK of video memory\n", 452 "fb%d: Virtual frame buffer device, using %ldK of video memory\n",
@@ -462,9 +461,9 @@ err:
462 return retval; 461 return retval;
463} 462}
464 463
465static int vfb_remove(struct device *device) 464static int vfb_remove(struct platform_device *dev)
466{ 465{
467 struct fb_info *info = dev_get_drvdata(device); 466 struct fb_info *info = platform_get_drvdata(dev);
468 467
469 if (info) { 468 if (info) {
470 unregister_framebuffer(info); 469 unregister_framebuffer(info);
@@ -474,11 +473,12 @@ static int vfb_remove(struct device *device)
474 return 0; 473 return 0;
475} 474}
476 475
477static struct device_driver vfb_driver = { 476static struct platform_driver vfb_driver = {
478 .name = "vfb",
479 .bus = &platform_bus_type,
480 .probe = vfb_probe, 477 .probe = vfb_probe,
481 .remove = vfb_remove, 478 .remove = vfb_remove,
479 .driver = {
480 .name = "vfb",
481 },
482}; 482};
483 483
484static struct platform_device vfb_device = { 484static struct platform_device vfb_device = {
@@ -504,12 +504,12 @@ static int __init vfb_init(void)
504 if (!vfb_enable) 504 if (!vfb_enable)
505 return -ENXIO; 505 return -ENXIO;
506 506
507 ret = driver_register(&vfb_driver); 507 ret = platform_driver_register(&vfb_driver);
508 508
509 if (!ret) { 509 if (!ret) {
510 ret = platform_device_register(&vfb_device); 510 ret = platform_device_register(&vfb_device);
511 if (ret) 511 if (ret)
512 driver_unregister(&vfb_driver); 512 platform_driver_unregister(&vfb_driver);
513 } 513 }
514 return ret; 514 return ret;
515} 515}
@@ -520,7 +520,7 @@ module_init(vfb_init);
520static void __exit vfb_exit(void) 520static void __exit vfb_exit(void)
521{ 521{
522 platform_device_unregister(&vfb_device); 522 platform_device_unregister(&vfb_device);
523 driver_unregister(&vfb_driver); 523 platform_driver_unregister(&vfb_driver);
524} 524}
525 525
526module_exit(vfb_exit); 526module_exit(vfb_exit);