summaryrefslogtreecommitdiffstats
path: root/drivers/video/arcfb.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 22:32:44 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 22:32:44 +0000
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/video/arcfb.c
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff)
downloadtalos-op-linux-3ae5eaec1d2d9c0cf53745352e7d4b152810ba24.tar.gz
talos-op-linux-3ae5eaec1d2d9c0cf53745352e7d4b152810ba24.zip
[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 = {
.fb_ioctl = arcfb_ioctl,
};
-static int __init arcfb_probe(struct device *device)
+static int __init arcfb_probe(struct platform_device *dev)
{
- struct platform_device *dev = to_platform_device(device);
struct fb_info *info;
int retval = -ENOMEM;
int videomemorysize;
@@ -559,7 +558,7 @@ static int __init arcfb_probe(struct device *device)
retval = register_framebuffer(info);
if (retval < 0)
goto err1;
- dev_set_drvdata(&dev->dev, info);
+ platform_set_drvdata(dev, info);
if (irq) {
par->irq = irq;
if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ,
@@ -600,9 +599,9 @@ err:
return retval;
}
-static int arcfb_remove(struct device *device)
+static int arcfb_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);
@@ -612,11 +611,12 @@ static int arcfb_remove(struct device *device)
return 0;
}
-static struct device_driver arcfb_driver = {
- .name = "arcfb",
- .bus = &platform_bus_type,
+static struct platform_driver arcfb_driver = {
.probe = arcfb_probe,
.remove = arcfb_remove,
+ .driver = {
+ .name = "arcfb",
+ },
};
static struct platform_device *arcfb_device;
@@ -628,7 +628,7 @@ static int __init arcfb_init(void)
if (!arcfb_enable)
return -ENXIO;
- ret = driver_register(&arcfb_driver);
+ ret = platform_driver_register(&arcfb_driver);
if (!ret) {
arcfb_device = platform_device_alloc("arcfb", 0);
if (arcfb_device) {
@@ -638,7 +638,7 @@ static int __init arcfb_init(void)
}
if (ret) {
platform_device_put(arcfb_device);
- driver_unregister(&arcfb_driver);
+ platform_driver_unregister(&arcfb_driver);
}
}
return ret;
@@ -648,7 +648,7 @@ static int __init arcfb_init(void)
static void __exit arcfb_exit(void)
{
platform_device_unregister(arcfb_device);
- driver_unregister(&arcfb_driver);
+ platform_driver_unregister(&arcfb_driver);
}
module_param(num_cols, ulong, 0);
OpenPOWER on IntegriCloud