]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: don't check spi_controller::num_chipselect when parsing a dt device
authorJonas Gorski <jonas.gorski@gmail.com>
Mon, 15 Sep 2025 18:37:23 +0000 (20:37 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 22 Sep 2025 08:29:43 +0000 (09:29 +0100)
commit83c522fb642384aef43697aa5c7686363e9e92dd
tree3bd466ac23b7d79c651444420f0a2e78c8472020
parentf3982daccf42cefcd80218c76a6b5dd134fe97e3
spi: don't check spi_controller::num_chipselect when parsing a dt device

Do not validate spi_controller::num_chipselect against SPI_CS_CNT_MAX
when parsing an spi device firmware node.

Firstly this is the wrong place, and this should be done while
registering/validating the controller. Secondly, there is no reason for
that check, as SPI_CS_CNT_MAX controls the amount of chipselects a
device may have, not a controller may have.

So drop that check as it needlessly limits controllers to SPI_CS_CNT_MAX
number of chipselects.

Likewise, drop the check for number of device chipselects larger than
controller's number of chipselects, as __spi_add_device() will already
catch that as either one of the chip selects will be out of range, or
there is a duplicate one.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Link: https://patch.msgid.link/20250915183725.219473-6-jonas.gorski@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c