Skip to content

Commit 4426e6b

Browse files
webgeek1234broonie
authored andcommitted
spi: tegra114: Don't fail set_cs_timing when delays are zero
The original code would skip null delay pointers, but when the pointers were converted to point within the spi_device struct, the check was not updated to skip delays of zero. Hence all spi devices that didn't set delays would fail to probe. Fixes: 04e6bb0 ("spi: modify set_cs_timing parameter") Cc: stable@vger.kernel.org Signed-off-by: Aaron Kling <webgeek1234@gmail.com> Link: https://patch.msgid.link/20250423-spi-tegra114-v1-1-2d608bcc12f9@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 36fd627 commit 4426e6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/spi/spi-tegra114.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,9 @@ static int tegra_spi_set_hw_cs_timing(struct spi_device *spi)
728728
u32 inactive_cycles;
729729
u8 cs_state;
730730

731-
if (setup->unit != SPI_DELAY_UNIT_SCK ||
732-
hold->unit != SPI_DELAY_UNIT_SCK ||
733-
inactive->unit != SPI_DELAY_UNIT_SCK) {
731+
if ((setup->unit && setup->unit != SPI_DELAY_UNIT_SCK) ||
732+
(hold->unit && hold->unit != SPI_DELAY_UNIT_SCK) ||
733+
(inactive->unit && inactive->unit != SPI_DELAY_UNIT_SCK)) {
734734
dev_err(&spi->dev,
735735
"Invalid delay unit %d, should be SPI_DELAY_UNIT_SCK\n",
736736
SPI_DELAY_UNIT_SCK);

0 commit comments

Comments
 (0)