spi: consolidate setting message->spi
authorDavid Lechner <dlechner@baylibre.com>
Tue, 23 Jan 2024 21:49:46 +0000 (15:49 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 24 Jan 2024 16:13:38 +0000 (16:13 +0000)
commitb204aa0f99cfe3c9d796ecfc0bc6f3f89585789e
tree69927413ee63abc7de8bea87059692ecb8d8e636
parent18ab9e9e8889ecba23a5e8b7f8924f09284e33d8
spi: consolidate setting message->spi

Previously, __spi_sync() and __spi_async() set message->spi to the spi
device independently after calling __spi_validate(). __spi_validate()
also would conditionally set this if it needed to split the message
since it wasn't set yet.

Since both __spi_sync() and __spi_async() call __spi_validate(), we can
consolidate this into only setting message->spi once (unconditionally)
in __spi_validate(). This will also save any future callers of
__spi_validate() from also needing to set message->spi.

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