spi: avoid double validation in __spi_sync()
authorDavid Lechner <dlechner@baylibre.com>
Thu, 25 Jan 2024 23:47:31 +0000 (17:47 -0600)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jan 2024 14:35:43 +0000 (14:35 +0000)
commit0da9a5794cfda615668eaefde811e8ef378134fe
treedd9ae1bcf297458dadcdfe6e795038a09d8edf47
parenta6fc5c5b35f688480167a7a7947ddd91c07e72c8
spi: avoid double validation in __spi_sync()

The __spi_sync() function calls __spi_validate() early in the function.
Later, it can call spi_async_locked() which calls __spi_validate()
again. __spi_validate() is an expensive function, so we can improve
performance measurably by avoiding calling it twice.

Instead of calling spi_async_locked(), we can call __spi_async() with
the spin lock held.

spi_async_locked() is removed since there are no more callers.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://msgid.link/r/20240125234732.3530278-2-dlechner@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c