diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-04-13 19:12:29 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-18 18:10:44 -0400 |
commit | 61c7a080a5a061c976988fd4b844dfb468dda255 (patch) | |
tree | 8cb492b73f2755c38a6164d770da34d5af6486a0 /drivers/i2c/busses/i2c-cpm.c | |
parent | d12d42f744f805a9ccc33cd76f04b237cd83ce56 (diff) |
of: Always use 'struct device.of_node' to get device node pointer.
The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated. This patch
makes all readers of these elements use device.of_node instead.
(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/i2c/busses/i2c-cpm.c')
-rw-r--r-- | drivers/i2c/busses/i2c-cpm.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 9c2e10082b79..48d2c1a0d4ce 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c | |||
@@ -440,7 +440,7 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
440 | 440 | ||
441 | init_waitqueue_head(&cpm->i2c_wait); | 441 | init_waitqueue_head(&cpm->i2c_wait); |
442 | 442 | ||
443 | cpm->irq = of_irq_to_resource(ofdev->node, 0, NULL); | 443 | cpm->irq = of_irq_to_resource(ofdev->dev.of_node, 0, NULL); |
444 | if (cpm->irq == NO_IRQ) | 444 | if (cpm->irq == NO_IRQ) |
445 | return -EINVAL; | 445 | return -EINVAL; |
446 | 446 | ||
@@ -451,13 +451,13 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
451 | return ret; | 451 | return ret; |
452 | 452 | ||
453 | /* I2C parameter RAM */ | 453 | /* I2C parameter RAM */ |
454 | i2c_base = of_iomap(ofdev->node, 1); | 454 | i2c_base = of_iomap(ofdev->dev.of_node, 1); |
455 | if (i2c_base == NULL) { | 455 | if (i2c_base == NULL) { |
456 | ret = -EINVAL; | 456 | ret = -EINVAL; |
457 | goto out_irq; | 457 | goto out_irq; |
458 | } | 458 | } |
459 | 459 | ||
460 | if (of_device_is_compatible(ofdev->node, "fsl,cpm1-i2c")) { | 460 | if (of_device_is_compatible(ofdev->dev.of_node, "fsl,cpm1-i2c")) { |
461 | 461 | ||
462 | /* Check for and use a microcode relocation patch. */ | 462 | /* Check for and use a microcode relocation patch. */ |
463 | cpm->i2c_ram = i2c_base; | 463 | cpm->i2c_ram = i2c_base; |
@@ -474,7 +474,7 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
474 | 474 | ||
475 | cpm->version = 1; | 475 | cpm->version = 1; |
476 | 476 | ||
477 | } else if (of_device_is_compatible(ofdev->node, "fsl,cpm2-i2c")) { | 477 | } else if (of_device_is_compatible(ofdev->dev.of_node, "fsl,cpm2-i2c")) { |
478 | cpm->i2c_addr = cpm_muram_alloc(sizeof(struct i2c_ram), 64); | 478 | cpm->i2c_addr = cpm_muram_alloc(sizeof(struct i2c_ram), 64); |
479 | cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr); | 479 | cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr); |
480 | out_be16(i2c_base, cpm->i2c_addr); | 480 | out_be16(i2c_base, cpm->i2c_addr); |
@@ -489,24 +489,24 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
489 | } | 489 | } |
490 | 490 | ||
491 | /* I2C control/status registers */ | 491 | /* I2C control/status registers */ |
492 | cpm->i2c_reg = of_iomap(ofdev->node, 0); | 492 | cpm->i2c_reg = of_iomap(ofdev->dev.of_node, 0); |
493 | if (cpm->i2c_reg == NULL) { | 493 | if (cpm->i2c_reg == NULL) { |
494 | ret = -EINVAL; | 494 | ret = -EINVAL; |
495 | goto out_ram; | 495 | goto out_ram; |
496 | } | 496 | } |
497 | 497 | ||
498 | data = of_get_property(ofdev->node, "fsl,cpm-command", &len); | 498 | data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len); |
499 | if (!data || len != 4) { | 499 | if (!data || len != 4) { |
500 | ret = -EINVAL; | 500 | ret = -EINVAL; |
501 | goto out_reg; | 501 | goto out_reg; |
502 | } | 502 | } |
503 | cpm->cp_command = *data; | 503 | cpm->cp_command = *data; |
504 | 504 | ||
505 | data = of_get_property(ofdev->node, "linux,i2c-class", &len); | 505 | data = of_get_property(ofdev->dev.of_node, "linux,i2c-class", &len); |
506 | if (data && len == 4) | 506 | if (data && len == 4) |
507 | cpm->adap.class = *data; | 507 | cpm->adap.class = *data; |
508 | 508 | ||
509 | data = of_get_property(ofdev->node, "clock-frequency", &len); | 509 | data = of_get_property(ofdev->dev.of_node, "clock-frequency", &len); |
510 | if (data && len == 4) | 510 | if (data && len == 4) |
511 | cpm->freq = *data; | 511 | cpm->freq = *data; |
512 | else | 512 | else |
@@ -661,7 +661,7 @@ static int __devinit cpm_i2c_probe(struct of_device *ofdev, | |||
661 | 661 | ||
662 | /* register new adapter to i2c module... */ | 662 | /* register new adapter to i2c module... */ |
663 | 663 | ||
664 | data = of_get_property(ofdev->node, "linux,i2c-index", &len); | 664 | data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len); |
665 | if (data && len == 4) { | 665 | if (data && len == 4) { |
666 | cpm->adap.nr = *data; | 666 | cpm->adap.nr = *data; |
667 | result = i2c_add_numbered_adapter(&cpm->adap); | 667 | result = i2c_add_numbered_adapter(&cpm->adap); |
@@ -679,7 +679,7 @@ static int __devinit cpm_i2c_probe(struct of_device *ofdev, | |||
679 | /* | 679 | /* |
680 | * register OF I2C devices | 680 | * register OF I2C devices |
681 | */ | 681 | */ |
682 | of_register_i2c_devices(&cpm->adap, ofdev->node); | 682 | of_register_i2c_devices(&cpm->adap, ofdev->dev.of_node); |
683 | 683 | ||
684 | return 0; | 684 | return 0; |
685 | out_shut: | 685 | out_shut: |