Re: [PATCH 5/5] spi: atmel: fix division by zero when transfer speed is zero
From: shao.mingyin
Date: Mon Nov 09 2026 - 22:36:46 EST
On Mon, Nov 09, 2026 at 08:27:03PM +0000, Mark Brown wrote:
> This has a similar issue with limiting, in this case even worse as we
> generate an invalid SCBR value and then validate it later in the
> function. We should just set the maximum instead of bothering with the
> division if we're subsituting a default here.
Agreed. v2 sets SCBR to 255 (the slowest clock) directly when
xfer->speed_hz is zero, instead of dividing and then failing the limit
check. The check itself stays for real speeds.
Thanks,
Shao Mingyin