Repository navigation
Commit 9080873
committed
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>1 parent 6ce4eac commit 9080873
1 file changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | | - | |
| 1599 | + | |
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
1603 | 1603 | | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
1607 | | - | |
1608 | 1604 | | |
1609 | 1605 | | |
1610 | 1606 | | |
| |||
1705 | 1701 | | |
1706 | 1702 | | |
1707 | 1703 | | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
1708 | 1716 | | |
1709 | 1717 | | |
1710 | 1718 | | |
| |||
1743 | 1751 | | |
1744 | 1752 | | |
1745 | 1753 | | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
1746 | 1758 | | |
1747 | 1759 | | |
1748 | 1760 | | |
| |||
1791 | 1803 | | |
1792 | 1804 | | |
1793 | 1805 | | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1794 | 1810 | | |
1795 | 1811 | | |
1796 | 1812 | | |
| |||
0 commit comments