diff options
author | Anatolij Gustschin <agust@denx.de> | 2013-01-10 19:05:48 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-02-05 09:44:12 -0500 |
commit | 9d15a3bac39e0a7945c463c26fd25c1c58280c68 (patch) | |
tree | 1f63921d8097ea97219700698510f97d3cc1c495 | |
parent | 2deff8d602e8c9a2cab4b070be829294e1211f2c (diff) |
spi/mpc512x-psc: don't use obsolet cell-index property
Remove deprecated cell-index property and use spi alias to
obtain the SPI PSC number used for SPI bus id.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-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, |