mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
This commit is contained in:
parent
559e2b7ee7
commit
12b15e8328
10 changed files with 27 additions and 24 deletions
|
|
@ -15,12 +15,11 @@
|
|||
/**
|
||||
* of_register_spi_devices - Register child devices onto the SPI bus
|
||||
* @master: Pointer to spi_master device
|
||||
* @np: parent node of SPI device nodes
|
||||
*
|
||||
* Registers an spi_device for each child node of 'np' which has a 'reg'
|
||||
* Registers an spi_device for each child node of master node which has a 'reg'
|
||||
* property.
|
||||
*/
|
||||
void of_register_spi_devices(struct spi_master *master, struct device_node *np)
|
||||
void of_register_spi_devices(struct spi_master *master)
|
||||
{
|
||||
struct spi_device *spi;
|
||||
struct device_node *nc;
|
||||
|
|
@ -28,7 +27,10 @@ void of_register_spi_devices(struct spi_master *master, struct device_node *np)
|
|||
int rc;
|
||||
int len;
|
||||
|
||||
for_each_child_of_node(np, nc) {
|
||||
if (!master->dev.of_node)
|
||||
return;
|
||||
|
||||
for_each_child_of_node(master->dev.of_node, nc) {
|
||||
/* Alloc an spi_device */
|
||||
spi = spi_alloc_device(master);
|
||||
if (!spi) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue