aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/mpc52xx_psc_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/mpc52xx_psc_spi.c')
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 77d4cc88ede..7104cb739da 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}
@@ -513,14 +514,12 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = {
513MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); 514MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
514 515
515static struct of_platform_driver mpc52xx_psc_spi_of_driver = { 516static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
516 .owner = THIS_MODULE,
517 .name = "mpc52xx-psc-spi",
518 .match_table = mpc52xx_psc_spi_of_match,
519 .probe = mpc52xx_psc_spi_of_probe, 517 .probe = mpc52xx_psc_spi_of_probe,
520 .remove = __exit_p(mpc52xx_psc_spi_of_remove), 518 .remove = __exit_p(mpc52xx_psc_spi_of_remove),
521 .driver = { 519 .driver = {
522 .name = "mpc52xx-psc-spi", 520 .name = "mpc52xx-psc-spi",
523 .owner = THIS_MODULE, 521 .owner = THIS_MODULE,
522 .of_match_table = mpc52xx_psc_spi_of_match,
524 }, 523 },
525}; 524};
526 525