Skip to content

Commit e979a7c

Browse files
webgeek1234broonie
authored andcommitted
spi: tegra114: Use value to check for invalid delays
A delay unit of 0 is a valid entry, thus it is not valid to check for unused delays. Instead, check the value field; if that is zero, the given delay is unset. Fixes: 4426e6b ("spi: tegra114: Don't fail set_cs_timing when delays are zero") Cc: stable@vger.kernel.org Signed-off-by: Aaron Kling <webgeek1234@gmail.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20250506-spi-tegra114-fixup-v1-1-136dc2f732f3@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a73fa36 commit e979a7c

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 && setup->unit != SPI_DELAY_UNIT_SCK) ||
732-
(hold->unit && hold->unit != SPI_DELAY_UNIT_SCK) ||
733-
(inactive->unit && inactive->unit != SPI_DELAY_UNIT_SCK)) {
731+
if ((setup->value && setup->unit != SPI_DELAY_UNIT_SCK) ||
732+
(hold->value && hold->unit != SPI_DELAY_UNIT_SCK) ||
733+
(inactive->value && 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)