aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mpc.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-04-13 19:12:29 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-18 18:10:44 -0400
commit61c7a080a5a061c976988fd4b844dfb468dda255 (patch)
tree8cb492b73f2755c38a6164d770da34d5af6486a0 /drivers/i2c/busses/i2c-mpc.c
parentd12d42f744f805a9ccc33cd76f04b237cd83ce56 (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-mpc.c')
-rw-r--r--drivers/i2c/busses/i2c-mpc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index f1321f763789..69473b6c260c 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -560,14 +560,14 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
560 560
561 init_waitqueue_head(&i2c->queue); 561 init_waitqueue_head(&i2c->queue);
562 562
563 i2c->base = of_iomap(op->node, 0); 563 i2c->base = of_iomap(op->dev.of_node, 0);
564 if (!i2c->base) { 564 if (!i2c->base) {
565 dev_err(i2c->dev, "failed to map controller\n"); 565 dev_err(i2c->dev, "failed to map controller\n");
566 result = -ENOMEM; 566 result = -ENOMEM;
567 goto fail_map; 567 goto fail_map;
568 } 568 }
569 569
570 i2c->irq = irq_of_parse_and_map(op->node, 0); 570 i2c->irq = irq_of_parse_and_map(op->dev.of_node, 0);
571 if (i2c->irq != NO_IRQ) { /* i2c->irq = NO_IRQ implies polling */ 571 if (i2c->irq != NO_IRQ) { /* i2c->irq = NO_IRQ implies polling */
572 result = request_irq(i2c->irq, mpc_i2c_isr, 572 result = request_irq(i2c->irq, mpc_i2c_isr,
573 IRQF_SHARED, "i2c-mpc", i2c); 573 IRQF_SHARED, "i2c-mpc", i2c);
@@ -577,21 +577,22 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
577 } 577 }
578 } 578 }
579 579
580 if (of_get_property(op->node, "fsl,preserve-clocking", NULL)) { 580 if (of_get_property(op->dev.of_node, "fsl,preserve-clocking", NULL)) {
581 clock = MPC_I2C_CLOCK_PRESERVE; 581 clock = MPC_I2C_CLOCK_PRESERVE;
582 } else { 582 } else {
583 prop = of_get_property(op->node, "clock-frequency", &plen); 583 prop = of_get_property(op->dev.of_node, "clock-frequency",
584 &plen);
584 if (prop && plen == sizeof(u32)) 585 if (prop && plen == sizeof(u32))
585 clock = *prop; 586 clock = *prop;
586 } 587 }
587 588
588 if (match->data) { 589 if (match->data) {
589 struct mpc_i2c_data *data = match->data; 590 struct mpc_i2c_data *data = match->data;
590 data->setup(op->node, i2c, clock, data->prescaler); 591 data->setup(op->dev.of_node, i2c, clock, data->prescaler);
591 } else { 592 } else {
592 /* Backwards compatibility */ 593 /* Backwards compatibility */
593 if (of_get_property(op->node, "dfsrr", NULL)) 594 if (of_get_property(op->dev.of_node, "dfsrr", NULL))
594 mpc_i2c_setup_8xxx(op->node, i2c, clock, 0); 595 mpc_i2c_setup_8xxx(op->dev.of_node, i2c, clock, 0);
595 } 596 }
596 597
597 dev_set_drvdata(&op->dev, i2c); 598 dev_set_drvdata(&op->dev, i2c);
@@ -605,7 +606,7 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
605 dev_err(i2c->dev, "failed to add adapter\n"); 606 dev_err(i2c->dev, "failed to add adapter\n");
606 goto fail_add; 607 goto fail_add;
607 } 608 }
608 of_register_i2c_devices(&i2c->adap, op->node); 609 of_register_i2c_devices(&i2c->adap, op->dev.of_node);
609 610
610 return result; 611 return result;
611 612