aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mv64xxx.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2006-01-03 02:18:01 -0500
committerDave Airlie <airlied@linux.ie>2006-01-03 02:18:01 -0500
commit97f2aab6698f3ab2552c41c1024a65ffd0763a6d (patch)
treebb6e3b2949459f54f884c710fc74d40eef00d834 /drivers/i2c/busses/i2c-mv64xxx.c
parentd985c1088146607532093d9eaaaf99758f6a4d21 (diff)
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
drm: merge in Linus mainline
Diffstat (limited to 'drivers/i2c/busses/i2c-mv64xxx.c')
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 6b48027b2ee3..81031eb51056 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,18 +525,19 @@ 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,
533 MV64XXX_I2C_CTLR_NAME, drv_data)) { 532 MV64XXX_I2C_CTLR_NAME, drv_data)) {
534 533 dev_err(&drv_data->adapter.dev,
535 dev_err(dev, "mv64xxx: Can't register intr handler " 534 "mv64xxx: Can't register intr handler irq: %d\n",
536 "irq: %d\n", drv_data->irq); 535 drv_data->irq);
537 rc = -EINVAL; 536 rc = -EINVAL;
538 goto exit_unmap_regs; 537 goto exit_unmap_regs;
539 } else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) { 538 } else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) {
540 dev_err(dev, "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc); 539 dev_err(&drv_data->adapter.dev,
540 "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc);
541 goto exit_free_irq; 541 goto exit_free_irq;
542 } 542 }
543 543
@@ -555,9 +555,9 @@ mv64xxx_i2c_probe(struct device *dev)
555} 555}
556 556
557static int __devexit 557static int __devexit
558mv64xxx_i2c_remove(struct device *dev) 558mv64xxx_i2c_remove(struct platform_device *dev)
559{ 559{
560 struct mv64xxx_i2c_data *drv_data = dev_get_drvdata(dev); 560 struct mv64xxx_i2c_data *drv_data = platform_get_drvdata(dev);
561 int rc; 561 int rc;
562 562
563 rc = i2c_del_adapter(&drv_data->adapter); 563 rc = i2c_del_adapter(&drv_data->adapter);
@@ -568,24 +568,25 @@ mv64xxx_i2c_remove(struct device *dev)
568 return rc; 568 return rc;
569} 569}
570 570
571static struct device_driver mv64xxx_i2c_driver = { 571static 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, 572 .probe = mv64xxx_i2c_probe,
576 .remove = mv64xxx_i2c_remove, 573 .remove = mv64xxx_i2c_remove,
574 .driver = {
575 .owner = THIS_MODULE,
576 .name = MV64XXX_I2C_CTLR_NAME,
577 },
577}; 578};
578 579
579static int __init 580static int __init
580mv64xxx_i2c_init(void) 581mv64xxx_i2c_init(void)
581{ 582{
582 return driver_register(&mv64xxx_i2c_driver); 583 return platform_driver_register(&mv64xxx_i2c_driver);
583} 584}
584 585
585static void __exit 586static void __exit
586mv64xxx_i2c_exit(void) 587mv64xxx_i2c_exit(void)
587{ 588{
588 driver_unregister(&mv64xxx_i2c_driver); 589 platform_driver_unregister(&mv64xxx_i2c_driver);
589} 590}
590 591
591module_init(mv64xxx_i2c_init); 592module_init(mv64xxx_i2c_init);