diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2006-01-03 02:18:01 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-01-03 02:18:01 -0500 |
commit | 97f2aab6698f3ab2552c41c1024a65ffd0763a6d (patch) | |
tree | bb6e3b2949459f54f884c710fc74d40eef00d834 /drivers/i2c/busses/i2c-mv64xxx.c | |
parent | d985c1088146607532093d9eaaaf99758f6a4d21 (diff) | |
parent | 88026842b0a760145aa71d69e74fbc9ec118ca44 (diff) |
drm: merge in Linus mainline
Diffstat (limited to 'drivers/i2c/busses/i2c-mv64xxx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 35 |
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 | ||
494 | static int __devinit | 494 | static int __devinit |
495 | mv64xxx_i2c_probe(struct device *dev) | 495 | mv64xxx_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 | ||
557 | static int __devexit | 557 | static int __devexit |
558 | mv64xxx_i2c_remove(struct device *dev) | 558 | mv64xxx_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 | ||
571 | static struct device_driver mv64xxx_i2c_driver = { | 571 | static 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 | ||
579 | static int __init | 580 | static int __init |
580 | mv64xxx_i2c_init(void) | 581 | mv64xxx_i2c_init(void) |
581 | { | 582 | { |
582 | return driver_register(&mv64xxx_i2c_driver); | 583 | return platform_driver_register(&mv64xxx_i2c_driver); |
583 | } | 584 | } |
584 | 585 | ||
585 | static void __exit | 586 | static void __exit |
586 | mv64xxx_i2c_exit(void) | 587 | mv64xxx_i2c_exit(void) |
587 | { | 588 | { |
588 | driver_unregister(&mv64xxx_i2c_driver); | 589 | platform_driver_unregister(&mv64xxx_i2c_driver); |
589 | } | 590 | } |
590 | 591 | ||
591 | module_init(mv64xxx_i2c_init); | 592 | module_init(mv64xxx_i2c_init); |