Skip to content

Commit c149bdf

Browse files
webgeek1234gregkh
authored andcommitted
spi: tegra114: Use value to check for invalid delays
commit e979a7c upstream. 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: [email protected] Signed-off-by: Aaron Kling <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 19260d3 commit c149bdf

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)