spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
authorMaxim Kochetkov <fido_max@inbox.ru>
Tue, 1 Dec 2020 08:59:16 +0000 (11:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:27 +0000 (11:53 +0100)
commitf107dfac508ff58649db32eacd918b567867507d
tree5afe8ffa3a3f98d7cb0e547fa2fe975e90bf1960
parentee9f3f0ff49649c9e763d7ec10be0abfdc497faf
spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR

[ Upstream commit 2c2b3ad2c4c801bab1eec7264ea6991b1e4e8f2c ]

If cs-gpios property is used in devicetree then ctlr->num_chipselect value
may be changed by spi_get_gpio_descs().
So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR

Fixes: 4fcc7c2292de (spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR)
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/20201201085916.63543-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-fsl-dspi.c