]> git.baikalelectronics.ru Git - kernel.git/commit
spi/of: Use DT aliases for assigning bus number
authorGrant Likely <grant.likely@secretlab.ca>
Fri, 21 Dec 2012 19:32:09 +0000 (19:32 +0000)
committerGrant Likely <grant.likely@secretlab.ca>
Tue, 5 Feb 2013 12:26:59 +0000 (12:26 +0000)
commit7534007d5f842961321c6b5cf3b11c297ec2973a
treee6814ea5c06407a8fe57ad154a797f15ed6a0403
parent93f7f5ffddfe9418f41916734287c52064f6df19
spi/of: Use DT aliases for assigning bus number

Linux assigns a number to each spi_master in the system, but when the
platform used the device tree, the numbers are dynamically assigned and
are not predictable. In general this shouldn't matter since the kernel
doesn't use the bus number for anything other than matching a bus to
spi_boardinfo (not used for DT). However, sometimes userspace needs to
figure out which bus is which, so it makes sense to use the global
/aliases namespace to choose a specific bus number.

It is safe to derive the bus number from an alias because aliases will
never cause two buses to try and use the same bus number. (At one time
the cell-index property was used for this purpose, but cell-index has
the risk of an id collision).

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/spi/spi.c