aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sa1100fb.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/sa1100fb.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/sa1100fb.c')
-rw-r--r--drivers/video/sa1100fb.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index a5184575cfae..2ea1354e439f 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1308,17 +1308,17 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
1308 * Power management hooks. Note that we won't be called from IRQ context, 1308 * Power management hooks. Note that we won't be called from IRQ context,
1309 * unlike the blank functions above, so we may sleep. 1309 * unlike the blank functions above, so we may sleep.
1310 */ 1310 */
1311static int sa1100fb_suspend(struct device *dev, pm_message_t state) 1311static int sa1100fb_suspend(struct platform_device *dev, pm_message_t state)
1312{ 1312{
1313 struct sa1100fb_info *fbi = dev_get_drvdata(dev); 1313 struct sa1100fb_info *fbi = platform_get_drvdata(dev);
1314 1314
1315 set_ctrlr_state(fbi, C_DISABLE_PM); 1315 set_ctrlr_state(fbi, C_DISABLE_PM);
1316 return 0; 1316 return 0;
1317} 1317}
1318 1318
1319static int sa1100fb_resume(struct device *dev) 1319static int sa1100fb_resume(struct platform_device *dev)
1320{ 1320{
1321 struct sa1100fb_info *fbi = dev_get_drvdata(dev); 1321 struct sa1100fb_info *fbi = platform_get_drvdata(dev);
1322 1322
1323 set_ctrlr_state(fbi, C_ENABLE_PM); 1323 set_ctrlr_state(fbi, C_ENABLE_PM);
1324 return 0; 1324 return 0;
@@ -1452,7 +1452,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
1452 return fbi; 1452 return fbi;
1453} 1453}
1454 1454
1455static int __init sa1100fb_probe(struct device *dev) 1455static int __init sa1100fb_probe(struct platform_device *pdev)
1456{ 1456{
1457 struct sa1100fb_info *fbi; 1457 struct sa1100fb_info *fbi;
1458 int ret; 1458 int ret;
@@ -1460,7 +1460,7 @@ static int __init sa1100fb_probe(struct device *dev)
1460 if (!request_mem_region(0xb0100000, 0x10000, "LCD")) 1460 if (!request_mem_region(0xb0100000, 0x10000, "LCD"))
1461 return -EBUSY; 1461 return -EBUSY;
1462 1462
1463 fbi = sa1100fb_init_fbinfo(dev); 1463 fbi = sa1100fb_init_fbinfo(&pdev->dev);
1464 ret = -ENOMEM; 1464 ret = -ENOMEM;
1465 if (!fbi) 1465 if (!fbi)
1466 goto failed; 1466 goto failed;
@@ -1488,7 +1488,7 @@ static int __init sa1100fb_probe(struct device *dev)
1488 */ 1488 */
1489 sa1100fb_check_var(&fbi->fb.var, &fbi->fb); 1489 sa1100fb_check_var(&fbi->fb.var, &fbi->fb);
1490 1490
1491 dev_set_drvdata(dev, fbi); 1491 platform_set_drvdata(pdev, fbi);
1492 1492
1493 ret = register_framebuffer(&fbi->fb); 1493 ret = register_framebuffer(&fbi->fb);
1494 if (ret < 0) 1494 if (ret < 0)
@@ -1505,18 +1505,19 @@ static int __init sa1100fb_probe(struct device *dev)
1505 return 0; 1505 return 0;
1506 1506
1507failed: 1507failed:
1508 dev_set_drvdata(dev, NULL); 1508 platform_set_drvdata(pdev, NULL);
1509 kfree(fbi); 1509 kfree(fbi);
1510 release_mem_region(0xb0100000, 0x10000); 1510 release_mem_region(0xb0100000, 0x10000);
1511 return ret; 1511 return ret;
1512} 1512}
1513 1513
1514static struct device_driver sa1100fb_driver = { 1514static struct platform_driver sa1100fb_driver = {
1515 .name = "sa11x0-fb",
1516 .bus = &platform_bus_type,
1517 .probe = sa1100fb_probe, 1515 .probe = sa1100fb_probe,
1518 .suspend = sa1100fb_suspend, 1516 .suspend = sa1100fb_suspend,
1519 .resume = sa1100fb_resume, 1517 .resume = sa1100fb_resume,
1518 .driver = {
1519 .name = "sa11x0-fb",
1520 },
1520}; 1521};
1521 1522
1522int __init sa1100fb_init(void) 1523int __init sa1100fb_init(void)
@@ -1524,7 +1525,7 @@ int __init sa1100fb_init(void)
1524 if (fb_get_options("sa1100fb", NULL)) 1525 if (fb_get_options("sa1100fb", NULL))
1525 return -ENODEV; 1526 return -ENODEV;
1526 1527
1527 return driver_register(&sa1100fb_driver); 1528 return platform_driver_register(&sa1100fb_driver);
1528} 1529}
1529 1530
1530int __init sa1100fb_setup(char *options) 1531int __init sa1100fb_setup(char *options)