]> asedeno.scripts.mit.edu Git - linux.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)
commitbc3a8b295e5bca9d1ec2622a6ba38289f9fd3d8a
tree03943fcc82007134fbd5b34fa722d1c1ea286de4
parente7cc5cfbea4c9bd2c452cb81d0829e9259dd84d8
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: c7a402599504 ("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