]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Factor validation and initialisation of messages outside lock
authorMark Brown <broonie@linaro.org>
Wed, 13 Nov 2013 23:44:15 +0000 (23:44 +0000)
committerMark Brown <broonie@linaro.org>
Sun, 24 Nov 2013 14:04:17 +0000 (14:04 +0000)
commita2c5441f751c8ce7bd1fe213bb5a66bb9cf5284d
tree9a5debdf86da3fe08616f56c3c1246fe95f6f7d1
parent446a01ebfd5c46dcad993153e533f5f1d30e2d44
spi: Factor validation and initialisation of messages outside lock

Currently we do a bunch of per-message validation and initialisation in
__spi_async() which is called with the bus lock held. Since none of this
validation depends on the current bus status there's no need to hold the
lock to do it so split it out into a separate __spi_validate() function
which is called prior to taking the bus lock.

This could be slightly neater but keep things simple for now to show the
code motion clearly.

Based on observations from Martin Sperl.

Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi.c