diff options
author | Anatolij Gustschin <agust@denx.de> | 2010-07-27 16:35:58 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-07-30 02:03:59 -0400 |
commit | 12b15e83289bc7cf2ec9a342412e0c955beeb395 (patch) | |
tree | da1560511f56a9c63246be0ff449229c7adf36b1 /drivers/spi/mpc52xx_psc_spi.c | |
parent | 559e2b7ee7a1c7753d534abcb2742a4775339293 (diff) |
of/spi: call of_register_spi_devices() from spi core code
Move of_register_spi_devices() call from drivers to
spi_register_master(). Also change the function to use
the struct device_node pointer from master spi device
instead of passing it as function argument.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/mpc52xx_psc_spi.c')
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 7104cb739da7..bd81ff90cfb3 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #include <linux/of_spi.h> | ||
21 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
22 | #include <linux/completion.h> | 21 | #include <linux/completion.h> |
23 | #include <linux/io.h> | 22 | #include <linux/io.h> |
@@ -398,6 +397,7 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
398 | master->setup = mpc52xx_psc_spi_setup; | 397 | master->setup = mpc52xx_psc_spi_setup; |
399 | master->transfer = mpc52xx_psc_spi_transfer; | 398 | master->transfer = mpc52xx_psc_spi_transfer; |
400 | master->cleanup = mpc52xx_psc_spi_cleanup; | 399 | master->cleanup = mpc52xx_psc_spi_cleanup; |
400 | master->dev.of_node = dev->of_node; | ||
401 | 401 | ||
402 | mps->psc = ioremap(regaddr, size); | 402 | mps->psc = ioremap(regaddr, size); |
403 | if (!mps->psc) { | 403 | if (!mps->psc) { |
@@ -470,7 +470,6 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op, | |||
470 | const u32 *regaddr_p; | 470 | const u32 *regaddr_p; |
471 | u64 regaddr64, size64; | 471 | u64 regaddr64, size64; |
472 | s16 id = -1; | 472 | s16 id = -1; |
473 | int rc; | ||
474 | 473 | ||
475 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); | 474 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); |
476 | if (!regaddr_p) { | 475 | if (!regaddr_p) { |
@@ -491,13 +490,8 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op, | |||
491 | id = *psc_nump + 1; | 490 | id = *psc_nump + 1; |
492 | } | 491 | } |
493 | 492 | ||
494 | rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, | 493 | return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, |
495 | irq_of_parse_and_map(op->dev.of_node, 0), id); | 494 | irq_of_parse_and_map(op->dev.of_node, 0), id); |
496 | if (rc == 0) | ||
497 | of_register_spi_devices(dev_get_drvdata(&op->dev), | ||
498 | op->dev.of_node); | ||
499 | |||
500 | return rc; | ||
501 | } | 495 | } |
502 | 496 | ||
503 | static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op) | 497 | static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op) |