]> git.baikalelectronics.ru Git - kernel.git/commit
spi: bcm2835: Allow arbitrary number of slaves
authorLukas Wunner <lukas@wunner.de>
Thu, 27 May 2021 21:32:00 +0000 (23:32 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 2 Jun 2021 11:03:39 +0000 (12:03 +0100)
commit8638c7f5ff942978c4b853a5f43ea959a1d3c4cf
tree4ae7588911e8a18b7aeffeac95c2104c2faf3349
parent4f790da15d38e9f1740805c36fbd031070ed3cb4
spi: bcm2835: Allow arbitrary number of slaves

Since commit bebf13cdcea4 ("spi: bcm2835: Cache CS register value for
->prepare_message()"), the number of slaves has been limited by a
compile-time constant.  This was necessitated by statically-sized
arrays in the driver private data which contain per-slave register
values.

As suggested by Mark, move those register values to a per-slave
controller_state which is allocated on ->setup and freed on ->cleanup.
The limitation on the number of slaves is thus lifted.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Joe Burmeister <joe.burmeister@devtank.co.uk>
Cc: Phil Elwell <phil@raspberrypi.com>
Link: https://lore.kernel.org/r/a847c01f09400801e74e0630bf5a0197591554da.1622150204.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm2835.c