aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/arcfb.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/arcfb.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/arcfb.c')
-rw-r--r--drivers/video/arcfb.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index a1fc8bbb1090..080db812ca48 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -514,9 +514,8 @@ static struct fb_ops arcfb_ops = {
514 .fb_ioctl = arcfb_ioctl, 514 .fb_ioctl = arcfb_ioctl,
515}; 515};
516 516
517static int __init arcfb_probe(struct device *device) 517static int __init arcfb_probe(struct platform_device *dev)
518{ 518{
519 struct platform_device *dev = to_platform_device(device);
520 struct fb_info *info; 519 struct fb_info *info;
521 int retval = -ENOMEM; 520 int retval = -ENOMEM;
522 int videomemorysize; 521 int videomemorysize;
@@ -559,7 +558,7 @@ static int __init arcfb_probe(struct device *device)
559 retval = register_framebuffer(info); 558 retval = register_framebuffer(info);
560 if (retval < 0) 559 if (retval < 0)
561 goto err1; 560 goto err1;
562 dev_set_drvdata(&dev->dev, info); 561 platform_set_drvdata(dev, info);
563 if (irq) { 562 if (irq) {
564 par->irq = irq; 563 par->irq = irq;
565 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ, 564 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ,
@@ -600,9 +599,9 @@ err:
600 return retval; 599 return retval;
601} 600}
602 601
603static int arcfb_remove(struct device *device) 602static int arcfb_remove(struct platform_device *dev)
604{ 603{
605 struct fb_info *info = dev_get_drvdata(device); 604 struct fb_info *info = platform_get_drvdata(dev);
606 605
607 if (info) { 606 if (info) {
608 unregister_framebuffer(info); 607 unregister_framebuffer(info);
@@ -612,11 +611,12 @@ static int arcfb_remove(struct device *device)
612 return 0; 611 return 0;
613} 612}
614 613
615static struct device_driver arcfb_driver = { 614static struct platform_driver arcfb_driver = {
616 .name = "arcfb",
617 .bus = &platform_bus_type,
618 .probe = arcfb_probe, 615 .probe = arcfb_probe,
619 .remove = arcfb_remove, 616 .remove = arcfb_remove,
617 .driver = {
618 .name = "arcfb",
619 },
620}; 620};
621 621
622static struct platform_device *arcfb_device; 622static struct platform_device *arcfb_device;
@@ -628,7 +628,7 @@ static int __init arcfb_init(void)
628 if (!arcfb_enable) 628 if (!arcfb_enable)
629 return -ENXIO; 629 return -ENXIO;
630 630
631 ret = driver_register(&arcfb_driver); 631 ret = platform_driver_register(&arcfb_driver);
632 if (!ret) { 632 if (!ret) {
633 arcfb_device = platform_device_alloc("arcfb", 0); 633 arcfb_device = platform_device_alloc("arcfb", 0);
634 if (arcfb_device) { 634 if (arcfb_device) {
@@ -638,7 +638,7 @@ static int __init arcfb_init(void)
638 } 638 }
639 if (ret) { 639 if (ret) {
640 platform_device_put(arcfb_device); 640 platform_device_put(arcfb_device);
641 driver_unregister(&arcfb_driver); 641 platform_driver_unregister(&arcfb_driver);
642 } 642 }
643 } 643 }
644 return ret; 644 return ret;
@@ -648,7 +648,7 @@ static int __init arcfb_init(void)
648static void __exit arcfb_exit(void) 648static void __exit arcfb_exit(void)
649{ 649{
650 platform_device_unregister(arcfb_device); 650 platform_device_unregister(arcfb_device);
651 driver_unregister(&arcfb_driver); 651 platform_driver_unregister(&arcfb_driver);
652} 652}
653 653
654module_param(num_cols, ulong, 0); 654module_param(num_cols, ulong, 0);