]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Check conflicting CS based on spi->chip_select instead of device name
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 9 Jan 2014 13:23:55 +0000 (15:23 +0200)
committerMark Brown <broonie@linaro.org>
Thu, 9 Jan 2014 14:07:08 +0000 (14:07 +0000)
commit32f0def83290cc30a921ff9ff0e8f57071035799
treec379808ae918ef30237babce2ded0ff5c372c337
parent5b2ef002c1aea6430422d7fb975f0647c72a499f
spi: Check conflicting CS based on spi->chip_select instead of device name

Commit 931461c71c8e (spi: Use stable dev_name for ACPI enumerated SPI
slaves) changed the SPI device naming to be based on ACPI device name
instead of carrying bus number and chip select for devices enumerated
from ACPI namespace.

In case of a buggy BIOS that lists multiple SPI devices sharing the same
chip select (even though they should use different) the current code fails
to detect that and allows the devices to be added to the bus.

Fix this by walking through the bus and comparing spi->chip_select instead
of device name. This should work regardless what the device name will be in
future.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi.c