Skip to content

Commit

Permalink
spi: tegra114: Use value to check for invalid delays
Browse files Browse the repository at this point in the history
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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Aaron Kling authored and Greg Kroah-Hartman committed May 22, 2025
1 parent 19260d3 commit c149bdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi-tegra114.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ static int tegra_spi_set_hw_cs_timing(struct spi_device *spi)
u32 inactive_cycles;
u8 cs_state;

if ((setup->unit && setup->unit != SPI_DELAY_UNIT_SCK) ||
(hold->unit && hold->unit != SPI_DELAY_UNIT_SCK) ||
(inactive->unit && inactive->unit != SPI_DELAY_UNIT_SCK)) {
if ((setup->value && setup->unit != SPI_DELAY_UNIT_SCK) ||
(hold->value && hold->unit != SPI_DELAY_UNIT_SCK) ||
(inactive->value && inactive->unit != SPI_DELAY_UNIT_SCK)) {
dev_err(&spi->dev,
"Invalid delay unit %d, should be SPI_DELAY_UNIT_SCK\n",
SPI_DELAY_UNIT_SCK);
Expand Down

0 comments on commit c149bdf

Please sign in to comment.