]> git.baikalelectronics.ru Git - kernel.git/commit
spi: fsl-lpspi: fix only one cs-gpio working
authorPhilippe Schenker <philippe.schenker@toradex.com>
Wed, 4 Dec 2019 14:13:33 +0000 (14:13 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 14 Jan 2020 16:03:29 +0000 (16:03 +0000)
commit560d069ff89c9356506b3d7841780365acdb2c7c
tree03943fcc82007134fbd5b34fa722d1c1ea286de4
parente5a4ba8d32f6e53eacb32393aba86419386a4765
spi: fsl-lpspi: fix only one cs-gpio working

Why it does not work at the moment:
- num_chipselect sets the number of cs-gpios that are in the DT.
  This comes from drivers/spi/spi.c
- num_chipselect gets set with devm_spi_register_controller, that is
  called in drivers/spi/spi.c
- devm_spi_register_controller got called after num_chipselect has
  been used.

How this commit fixes the issue:
- devm_spi_register_controller gets called before num_chipselect is
  being used.

Fixes: 2fc8fc8c5dee ("spi: lpspi: use the core way to implement cs-gpio function")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Link: https://lore.kernel.org/r/20191204141312.1411251-1-philippe.schenker@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-lpspi.c