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/of/of_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/of/of_spi.c')
-rw-r--r-- | drivers/of/of_spi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/of/of_spi.c b/drivers/of/of_spi.c index d504f1d1324b..1dbce58a58b0 100644 --- a/drivers/of/of_spi.c +++ b/drivers/of/of_spi.c | |||
@@ -15,12 +15,11 @@ | |||
15 | /** | 15 | /** |
16 | * of_register_spi_devices - Register child devices onto the SPI bus | 16 | * of_register_spi_devices - Register child devices onto the SPI bus |
17 | * @master: Pointer to spi_master device | 17 | * @master: Pointer to spi_master device |
18 | * @np: parent node of SPI device nodes | ||
19 | * | 18 | * |
20 | * Registers an spi_device for each child node of 'np' which has a 'reg' | 19 | * Registers an spi_device for each child node of master node which has a 'reg' |
21 | * property. | 20 | * property. |
22 | */ | 21 | */ |
23 | void of_register_spi_devices(struct spi_master *master, struct device_node *np) | 22 | void of_register_spi_devices(struct spi_master *master) |
24 | { | 23 | { |
25 | struct spi_device *spi; | 24 | struct spi_device *spi; |
26 | struct device_node *nc; | 25 | struct device_node *nc; |
@@ -28,7 +27,10 @@ void of_register_spi_devices(struct spi_master *master, struct device_node *np) | |||
28 | int rc; | 27 | int rc; |
29 | int len; | 28 | int len; |
30 | 29 | ||
31 | for_each_child_of_node(np, nc) { | 30 | if (!master->dev.of_node) |
31 | return; | ||
32 | |||
33 | for_each_child_of_node(master->dev.of_node, nc) { | ||
32 | /* Alloc an spi_device */ | 34 | /* Alloc an spi_device */ |
33 | spi = spi_alloc_device(master); | 35 | spi = spi_alloc_device(master); |
34 | if (!spi) { | 36 | if (!spi) { |