Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: octeon: Convert to let spi core validate transfer speed

Set master->max_speed_hz then spi core will handle checking transfer speed.
The behavior is different from current code when the speed_hz is greater than
the maximum transfer speed supported by the controller.
Unless there is other good reason, I think we had better make the behavior
consistent with what spi core does.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Axel Lin and committed by
Mark Brown
7984b5ca 85fe414d

+1 -2
+1 -2
drivers/spi/spi-octeon.c
··· 67 67 cpol = mode & SPI_CPOL; 68 68 69 69 speed_hz = xfer->speed_hz ? : spi->max_speed_hz; 70 - if (speed_hz > OCTEON_SPI_MAX_CLOCK_HZ) 71 - speed_hz = OCTEON_SPI_MAX_CLOCK_HZ; 72 70 73 71 clkdiv = octeon_get_io_clock_rate() / (2 * speed_hz); 74 72 ··· 212 214 213 215 master->transfer_one_message = octeon_spi_transfer_one_message; 214 216 master->bits_per_word_mask = SPI_BPW_MASK(8); 217 + master->max_speed_hz = OCTEON_SPI_MAX_CLOCK_HZ; 215 218 216 219 master->dev.of_node = pdev->dev.of_node; 217 220 err = devm_spi_register_master(&pdev->dev, master);