diff options
-rw-r--r-- | drivers/spi/spi-mpc512x-psc.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index cb3a3106bd4f..88e544151f6f 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c | |||
@@ -522,17 +522,11 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op) | |||
522 | regaddr64 = of_translate_address(op->dev.of_node, regaddr_p); | 522 | regaddr64 = of_translate_address(op->dev.of_node, regaddr_p); |
523 | 523 | ||
524 | /* get PSC id (0..11, used by port_config) */ | 524 | /* get PSC id (0..11, used by port_config) */ |
525 | if (op->dev.platform_data == NULL) { | 525 | id = of_alias_get_id(op->dev.of_node, "spi"); |
526 | const u32 *psc_nump; | 526 | if (id < 0) { |
527 | 527 | dev_err(&op->dev, "no alias id for %s\n", | |
528 | psc_nump = of_get_property(op->dev.of_node, "cell-index", NULL); | 528 | op->dev.of_node->full_name); |
529 | if (!psc_nump || *psc_nump > 11) { | 529 | return id; |
530 | dev_err(&op->dev, "mpc512x_psc_spi: Device node %s " | ||
531 | "has invalid cell-index property\n", | ||
532 | op->dev.of_node->full_name); | ||
533 | return -EINVAL; | ||
534 | } | ||
535 | id = *psc_nump; | ||
536 | } | 530 | } |
537 | 531 | ||
538 | return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64, | 532 | return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64, |