spi: sun6i: Use the new helper to derive the xfer timeout value
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 22 Jun 2023 09:06:34 +0000 (11:06 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 22 Jun 2023 21:22:54 +0000 (22:22 +0100)
commit6eef895581c9b5fcd002ff77837e0c3a4b1eecf6
treea6e1461650d482a259865f87ec236093fe47e15b
parente0205d6203c2ce598ae26d4b2707ca4224a9c90b
spi: sun6i: Use the new helper to derive the xfer timeout value

A helper was recently added to the core to factorize common code between
drivers, like the amount of time a driver should wait for a transfer to
happen.

It is of course possible to use a default value (like eg. 1s) but it is
way stronger to adapt this amount of time to the transfer. Indeed, long
transfers (eg. 4MiB) on a slow single-spi bus might take more than the
usual second of timeout and prevent lengthy transfers.

The core helper was heavily inspired by the logic applied in this
driver, the only difference being the minimum amount of time which was
enlarged from 0.1s to 0.5s.

Use this helper instead of open-coding it.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jernej Škrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/Message-Id:
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sun6i.c