]> git.ipfire.org Git - thirdparty/linux.git/commit
spi: allow ancillary devices to share parent's chip selects
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 6 Feb 2026 16:07:13 +0000 (18:07 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 23 Feb 2026 12:17:50 +0000 (12:17 +0000)
commitffef4123043c5bb29e61052a41e577ae1ee6837a
tree0132c0aa807d412934815624638efeef7577cbf8
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
spi: allow ancillary devices to share parent's chip selects

When registering an ancillary SPI device, the current code flags a chip
select conflict with the parent device. This happens because the
ancillary device intentionally uses one of the parent's chip selects,
but __spi_add_device() checks against all existing devices including
the parent.

Allow this by passing the parent device pointer to __spi_add_device()
and skipping the conflict check when the existing device is the parent.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/bcb1eb34fc5e86fd5dbb4472ad1d3ea3cf3e9779.1770393792.git.antoniu.miclaus@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c