Re: [PATCH v2 1/3] spi: Preserve preset cs_gpiod in __spi_add_device()
From: Mark Brown
Date: Mon Apr 13 2026 - 10:02:51 EST
On Mon, Apr 13, 2026 at 12:05:28PM +0200, Khalil wrote:
> __spi_add_device() unconditionally overwrites spi->cs_gpiod[] from
> ctlr->cs_gpiods[cs], even if the caller has already set a GPIO
> descriptor on the device. This prevents drivers like
> serial-multi-instantiate from pre-configuring a GPIO chip select
> acquired from ACPI before adding the device.
>
> Skip the overwrite when the device already has a cs_gpiod set for
> the given index, allowing callers to preset GPIO chip selects that
> aren't described in the controller's cs-gpios property.
This seems like it's almost certainly going to break something since we
just silently discard whatever the controller had set. We at the very
least want to warn about collisions here, and ideally teach the
controller about bindings so we don't get two bits of software fighting.
Attachment:
signature.asc
Description: PGP signature