When i was testing the TPM2 device, I found that the driver always failed to register which used SPI bus and GPIO as CS signal, i found that the reason for the error was that CS could not be set correctly, so there fixed it. Fixes: 766c6b63aa044e ("spi: fix client driver breakages when using GPIO descriptors") Signed-off-by: Xin Hao <xhao@xxxxxxxxxxxxxxxxx> --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b08efe88ccd6..d4342909c1c8 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -826,7 +826,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable) if (spi->cs_gpiod) /* polarity handled by gpiolib */ gpiod_set_value_cansleep(spi->cs_gpiod, - enable1); + !enable); else /* * invert the enable line, as active low is -- 2.31.0