Re: [PATCH] spi: Fix the clamping of spi->max_speed_hz

2020-12-31 Thread Mark Brown
On Wed, 16 Dec 2020 11:23:21 +0200, Tudor Ambarus wrote: > If spi->controller->max_speed_hz is zero, a non-zero spi->max_speed_hz > will be overwritten by zero. Make sure spi->controller->max_speed_hz > is not zero when clamping spi->max_speed_hz. > > Put the spi->controller->max_speed_hz

Re: [PATCH] spi: Fix the clamping of spi->max_speed_hz

2020-12-16 Thread Geert Uytterhoeven
On Wed, Dec 16, 2020 at 10:23 AM Tudor Ambarus wrote: > If spi->controller->max_speed_hz is zero, a non-zero spi->max_speed_hz > will be overwritten by zero. Make sure spi->controller->max_speed_hz > is not zero when clamping spi->max_speed_hz. > > Put the spi->controller->max_speed_hz non-zero

[PATCH] spi: Fix the clamping of spi->max_speed_hz

2020-12-16 Thread Tudor Ambarus
If spi->controller->max_speed_hz is zero, a non-zero spi->max_speed_hz will be overwritten by zero. Make sure spi->controller->max_speed_hz is not zero when clamping spi->max_speed_hz. Put the spi->controller->max_speed_hz non-zero check higher in the if, so that we avoid a superfluous init to