aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mv64xxx.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/i2c/busses/i2c-mv64xxx.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/i2c/busses/i2c-mv64xxx.c')
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 6b48027b2ee3..afd7634e5cc9 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -492,11 +492,10 @@ mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data)
492} 492}
493 493
494static int __devinit 494static int __devinit
495mv64xxx_i2c_probe(struct device *dev) 495mv64xxx_i2c_probe(struct platform_device *pd)
496{ 496{
497 struct platform_device *pd = to_platform_device(dev);
498 struct mv64xxx_i2c_data *drv_data; 497 struct mv64xxx_i2c_data *drv_data;
499 struct mv64xxx_i2c_pdata *pdata = dev->platform_data; 498 struct mv64xxx_i2c_pdata *pdata = pd->dev.platform_data;
500 int rc; 499 int rc;
501 500
502 if ((pd->id != 0) || !pdata) 501 if ((pd->id != 0) || !pdata)
@@ -526,7 +525,7 @@ mv64xxx_i2c_probe(struct device *dev)
526 drv_data->adapter.class = I2C_CLASS_HWMON; 525 drv_data->adapter.class = I2C_CLASS_HWMON;
527 drv_data->adapter.timeout = pdata->timeout; 526 drv_data->adapter.timeout = pdata->timeout;
528 drv_data->adapter.retries = pdata->retries; 527 drv_data->adapter.retries = pdata->retries;
529 dev_set_drvdata(dev, drv_data); 528 platform_set_drvdata(pd, drv_data);
530 i2c_set_adapdata(&drv_data->adapter, drv_data); 529 i2c_set_adapdata(&drv_data->adapter, drv_data);
531 530
532 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, 531 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0,
@@ -555,9 +554,9 @@ mv64xxx_i2c_probe(struct device *dev)
555} 554}
556 555
557static int __devexit 556static int __devexit
558mv64xxx_i2c_remove(struct device *dev) 557mv64xxx_i2c_remove(struct platform_device *dev)
559{ 558{
560 struct mv64xxx_i2c_data *drv_data = dev_get_drvdata(dev); 559 struct mv64xxx_i2c_data *drv_data = platform_get_drvdata(dev);
561 int rc; 560 int rc;
562 561
563 rc = i2c_del_adapter(&drv_data->adapter); 562 rc = i2c_del_adapter(&drv_data->adapter);
@@ -568,24 +567,25 @@ mv64xxx_i2c_remove(struct device *dev)
568 return rc; 567 return rc;
569} 568}
570 569
571static struct device_driver mv64xxx_i2c_driver = { 570static struct platform_driver mv64xxx_i2c_driver = {
572 .owner = THIS_MODULE,
573 .name = MV64XXX_I2C_CTLR_NAME,
574 .bus = &platform_bus_type,
575 .probe = mv64xxx_i2c_probe, 571 .probe = mv64xxx_i2c_probe,
576 .remove = mv64xxx_i2c_remove, 572 .remove = mv64xxx_i2c_remove,
573 .driver = {
574 .owner = THIS_MODULE,
575 .name = MV64XXX_I2C_CTLR_NAME,
576 },
577}; 577};
578 578
579static int __init 579static int __init
580mv64xxx_i2c_init(void) 580mv64xxx_i2c_init(void)
581{ 581{
582 return driver_register(&mv64xxx_i2c_driver); 582 return platform_driver_register(&mv64xxx_i2c_driver);
583} 583}
584 584
585static void __exit 585static void __exit
586mv64xxx_i2c_exit(void) 586mv64xxx_i2c_exit(void)
587{ 587{
588 driver_unregister(&mv64xxx_i2c_driver); 588 platform_driver_unregister(&mv64xxx_i2c_driver);
589} 589}
590 590
591module_init(mv64xxx_i2c_init); 591module_init(mv64xxx_i2c_init);