diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 11 | ||||
-rw-r--r-- | drivers/spi/mpc52xx_spi.c | 14 | ||||
-rw-r--r-- | drivers/spi/spi_mpc8xxx.c | 8 |
3 files changed, 17 insertions, 16 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 77d4cc88ede..7fcf2840586 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c | |||
@@ -472,18 +472,18 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op, | |||
472 | s16 id = -1; | 472 | s16 id = -1; |
473 | int rc; | 473 | int rc; |
474 | 474 | ||
475 | regaddr_p = of_get_address(op->node, 0, &size64, NULL); | 475 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); |
476 | if (!regaddr_p) { | 476 | if (!regaddr_p) { |
477 | dev_err(&op->dev, "Invalid PSC address\n"); | 477 | dev_err(&op->dev, "Invalid PSC address\n"); |
478 | return -EINVAL; | 478 | return -EINVAL; |
479 | } | 479 | } |
480 | regaddr64 = of_translate_address(op->node, regaddr_p); | 480 | regaddr64 = of_translate_address(op->dev.of_node, regaddr_p); |
481 | 481 | ||
482 | /* get PSC id (1..6, used by port_config) */ | 482 | /* get PSC id (1..6, used by port_config) */ |
483 | if (op->dev.platform_data == NULL) { | 483 | if (op->dev.platform_data == NULL) { |
484 | const u32 *psc_nump; | 484 | const u32 *psc_nump; |
485 | 485 | ||
486 | psc_nump = of_get_property(op->node, "cell-index", NULL); | 486 | psc_nump = of_get_property(op->dev.of_node, "cell-index", NULL); |
487 | if (!psc_nump || *psc_nump > 5) { | 487 | if (!psc_nump || *psc_nump > 5) { |
488 | dev_err(&op->dev, "Invalid cell-index property\n"); | 488 | dev_err(&op->dev, "Invalid cell-index property\n"); |
489 | return -EINVAL; | 489 | return -EINVAL; |
@@ -492,9 +492,10 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op, | |||
492 | } | 492 | } |
493 | 493 | ||
494 | rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, | 494 | rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, |
495 | irq_of_parse_and_map(op->node, 0), id); | 495 | irq_of_parse_and_map(op->dev.of_node, 0), id); |
496 | if (rc == 0) | 496 | if (rc == 0) |
497 | of_register_spi_devices(dev_get_drvdata(&op->dev), op->node); | 497 | of_register_spi_devices(dev_get_drvdata(&op->dev), |
498 | op->dev.of_node); | ||
498 | 499 | ||
499 | return rc; | 500 | return rc; |
500 | } | 501 | } |
diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c index cd68f1ce5cc..6573233bf7c 100644 --- a/drivers/spi/mpc52xx_spi.c +++ b/drivers/spi/mpc52xx_spi.c | |||
@@ -403,7 +403,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
403 | 403 | ||
404 | /* MMIO registers */ | 404 | /* MMIO registers */ |
405 | dev_dbg(&op->dev, "probing mpc5200 SPI device\n"); | 405 | dev_dbg(&op->dev, "probing mpc5200 SPI device\n"); |
406 | regs = of_iomap(op->node, 0); | 406 | regs = of_iomap(op->dev.of_node, 0); |
407 | if (!regs) | 407 | if (!regs) |
408 | return -ENODEV; | 408 | return -ENODEV; |
409 | 409 | ||
@@ -445,11 +445,11 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
445 | ms = spi_master_get_devdata(master); | 445 | ms = spi_master_get_devdata(master); |
446 | ms->master = master; | 446 | ms->master = master; |
447 | ms->regs = regs; | 447 | ms->regs = regs; |
448 | ms->irq0 = irq_of_parse_and_map(op->node, 0); | 448 | ms->irq0 = irq_of_parse_and_map(op->dev.of_node, 0); |
449 | ms->irq1 = irq_of_parse_and_map(op->node, 1); | 449 | ms->irq1 = irq_of_parse_and_map(op->dev.of_node, 1); |
450 | ms->state = mpc52xx_spi_fsmstate_idle; | 450 | ms->state = mpc52xx_spi_fsmstate_idle; |
451 | ms->ipb_freq = mpc5xxx_get_bus_frequency(op->node); | 451 | ms->ipb_freq = mpc5xxx_get_bus_frequency(op->dev.of_node); |
452 | ms->gpio_cs_count = of_gpio_count(op->node); | 452 | ms->gpio_cs_count = of_gpio_count(op->dev.of_node); |
453 | if (ms->gpio_cs_count > 0) { | 453 | if (ms->gpio_cs_count > 0) { |
454 | master->num_chipselect = ms->gpio_cs_count; | 454 | master->num_chipselect = ms->gpio_cs_count; |
455 | ms->gpio_cs = kmalloc(ms->gpio_cs_count * sizeof(unsigned int), | 455 | ms->gpio_cs = kmalloc(ms->gpio_cs_count * sizeof(unsigned int), |
@@ -460,7 +460,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
460 | } | 460 | } |
461 | 461 | ||
462 | for (i = 0; i < ms->gpio_cs_count; i++) { | 462 | for (i = 0; i < ms->gpio_cs_count; i++) { |
463 | gpio_cs = of_get_gpio(op->node, i); | 463 | gpio_cs = of_get_gpio(op->dev.of_node, i); |
464 | if (gpio_cs < 0) { | 464 | if (gpio_cs < 0) { |
465 | dev_err(&op->dev, | 465 | dev_err(&op->dev, |
466 | "could not parse the gpio field " | 466 | "could not parse the gpio field " |
@@ -512,7 +512,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
512 | if (rc) | 512 | if (rc) |
513 | goto err_register; | 513 | goto err_register; |
514 | 514 | ||
515 | of_register_spi_devices(master, op->node); | 515 | of_register_spi_devices(master, op->dev.of_node); |
516 | dev_info(&ms->master->dev, "registered MPC5200 SPI bus\n"); | 516 | dev_info(&ms->master->dev, "registered MPC5200 SPI bus\n"); |
517 | 517 | ||
518 | return rc; | 518 | return rc; |
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c index 14d05231650..7572f98a419 100644 --- a/drivers/spi/spi_mpc8xxx.c +++ b/drivers/spi/spi_mpc8xxx.c | |||
@@ -797,7 +797,7 @@ static void mpc8xxx_spi_free_dummy_rx(void) | |||
797 | static unsigned long mpc8xxx_spi_cpm_get_pram(struct mpc8xxx_spi *mspi) | 797 | static unsigned long mpc8xxx_spi_cpm_get_pram(struct mpc8xxx_spi *mspi) |
798 | { | 798 | { |
799 | struct device *dev = mspi->dev; | 799 | struct device *dev = mspi->dev; |
800 | struct device_node *np = dev_archdata_get_node(&dev->archdata); | 800 | struct device_node *np = dev->of_node; |
801 | const u32 *iprop; | 801 | const u32 *iprop; |
802 | int size; | 802 | int size; |
803 | unsigned long spi_base_ofs; | 803 | unsigned long spi_base_ofs; |
@@ -851,7 +851,7 @@ static unsigned long mpc8xxx_spi_cpm_get_pram(struct mpc8xxx_spi *mspi) | |||
851 | static int mpc8xxx_spi_cpm_init(struct mpc8xxx_spi *mspi) | 851 | static int mpc8xxx_spi_cpm_init(struct mpc8xxx_spi *mspi) |
852 | { | 852 | { |
853 | struct device *dev = mspi->dev; | 853 | struct device *dev = mspi->dev; |
854 | struct device_node *np = dev_archdata_get_node(&dev->archdata); | 854 | struct device_node *np = dev->of_node; |
855 | const u32 *iprop; | 855 | const u32 *iprop; |
856 | int size; | 856 | int size; |
857 | unsigned long pram_ofs; | 857 | unsigned long pram_ofs; |
@@ -1123,7 +1123,7 @@ static void mpc8xxx_spi_cs_control(struct spi_device *spi, bool on) | |||
1123 | 1123 | ||
1124 | static int of_mpc8xxx_spi_get_chipselects(struct device *dev) | 1124 | static int of_mpc8xxx_spi_get_chipselects(struct device *dev) |
1125 | { | 1125 | { |
1126 | struct device_node *np = dev_archdata_get_node(&dev->archdata); | 1126 | struct device_node *np = dev->of_node; |
1127 | struct fsl_spi_platform_data *pdata = dev->platform_data; | 1127 | struct fsl_spi_platform_data *pdata = dev->platform_data; |
1128 | struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata); | 1128 | struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata); |
1129 | unsigned int ngpios; | 1129 | unsigned int ngpios; |
@@ -1224,7 +1224,7 @@ static int __devinit of_mpc8xxx_spi_probe(struct of_device *ofdev, | |||
1224 | const struct of_device_id *ofid) | 1224 | const struct of_device_id *ofid) |
1225 | { | 1225 | { |
1226 | struct device *dev = &ofdev->dev; | 1226 | struct device *dev = &ofdev->dev; |
1227 | struct device_node *np = ofdev->node; | 1227 | struct device_node *np = ofdev->dev.of_node; |
1228 | struct mpc8xxx_spi_probe_info *pinfo; | 1228 | struct mpc8xxx_spi_probe_info *pinfo; |
1229 | struct fsl_spi_platform_data *pdata; | 1229 | struct fsl_spi_platform_data *pdata; |
1230 | struct spi_master *master; | 1230 | struct spi_master *master; |