diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-15 21:43:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-17 20:14:57 -0500 |
commit | 3d8c869796b61f2dd7c1b84112902e199936c053 (patch) | |
tree | 140333f3ed617397571af8dd28d26120f970b92d | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
spi: mpc512x-psc: Remove redundant code to get bus_num from DT
For DT case, spi core will call of_alias_get_id() and set master->bus_num if it
was not set.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-mpc512x-psc.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 5032141eeeec..46cdfd2ac0fa 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c | |||
@@ -466,10 +466,8 @@ static void mpc512x_spi_cs_control(struct spi_device *spi, bool onoff) | |||
466 | gpio_set_value(spi->cs_gpio, onoff); | 466 | gpio_set_value(spi->cs_gpio, onoff); |
467 | } | 467 | } |
468 | 468 | ||
469 | /* bus_num is used only for the case dev->platform_data == NULL */ | ||
470 | static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, | 469 | static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, |
471 | u32 size, unsigned int irq, | 470 | u32 size, unsigned int irq) |
472 | s16 bus_num) | ||
473 | { | 471 | { |
474 | struct fsl_spi_platform_data *pdata = dev_get_platdata(dev); | 472 | struct fsl_spi_platform_data *pdata = dev_get_platdata(dev); |
475 | struct mpc512x_psc_spi *mps; | 473 | struct mpc512x_psc_spi *mps; |
@@ -488,7 +486,6 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
488 | 486 | ||
489 | if (pdata == NULL) { | 487 | if (pdata == NULL) { |
490 | mps->cs_control = mpc512x_spi_cs_control; | 488 | mps->cs_control = mpc512x_spi_cs_control; |
491 | master->bus_num = bus_num; | ||
492 | } else { | 489 | } else { |
493 | mps->cs_control = pdata->cs_control; | 490 | mps->cs_control = pdata->cs_control; |
494 | master->bus_num = pdata->bus_num; | 491 | master->bus_num = pdata->bus_num; |
@@ -574,7 +571,6 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op) | |||
574 | { | 571 | { |
575 | const u32 *regaddr_p; | 572 | const u32 *regaddr_p; |
576 | u64 regaddr64, size64; | 573 | u64 regaddr64, size64; |
577 | s16 id = -1; | ||
578 | 574 | ||
579 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); | 575 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); |
580 | if (!regaddr_p) { | 576 | if (!regaddr_p) { |
@@ -583,16 +579,8 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op) | |||
583 | } | 579 | } |
584 | regaddr64 = of_translate_address(op->dev.of_node, regaddr_p); | 580 | regaddr64 = of_translate_address(op->dev.of_node, regaddr_p); |
585 | 581 | ||
586 | /* get PSC id (0..11, used by port_config) */ | ||
587 | id = of_alias_get_id(op->dev.of_node, "spi"); | ||
588 | if (id < 0) { | ||
589 | dev_err(&op->dev, "no alias id for %s\n", | ||
590 | op->dev.of_node->full_name); | ||
591 | return id; | ||
592 | } | ||
593 | |||
594 | return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64, | 582 | return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64, |
595 | irq_of_parse_and_map(op->dev.of_node, 0), id); | 583 | irq_of_parse_and_map(op->dev.of_node, 0)); |
596 | } | 584 | } |
597 | 585 | ||
598 | static int mpc512x_psc_spi_of_remove(struct platform_device *op) | 586 | static int mpc512x_psc_spi_of_remove(struct platform_device *op) |