Commit 3b0e209
i2c: i801: add helper i801_restore_regs
In few places relevant registers are reset to their initial value on
driver load. Factor this out to new helper i801_restore_regs to avoid
code duplication.
Even though no actual problems are known, this patch may contribute
to avoiding potential issues by:
- restoring register values also in the error path of i2c_add_adapter
- making restoring registers the last step (especially in i801_remove)
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>1 parent 9412664 commit 3b0e209
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1629 | 1629 | | |
1630 | 1630 | | |
1631 | 1631 | | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
1632 | 1638 | | |
1633 | 1639 | | |
1634 | 1640 | | |
| |||
1755 | 1761 | | |
1756 | 1762 | | |
1757 | 1763 | | |
| 1764 | + | |
1758 | 1765 | | |
1759 | 1766 | | |
1760 | 1767 | | |
| |||
1779 | 1786 | | |
1780 | 1787 | | |
1781 | 1788 | | |
1782 | | - | |
1783 | 1789 | | |
1784 | 1790 | | |
1785 | 1791 | | |
1786 | 1792 | | |
1787 | | - | |
1788 | 1793 | | |
1789 | 1794 | | |
1790 | 1795 | | |
1791 | 1796 | | |
1792 | 1797 | | |
1793 | 1798 | | |
1794 | 1799 | | |
| 1800 | + | |
| 1801 | + | |
1795 | 1802 | | |
1796 | 1803 | | |
1797 | 1804 | | |
| |||
1802 | 1809 | | |
1803 | 1810 | | |
1804 | 1811 | | |
1805 | | - | |
1806 | | - | |
1807 | 1812 | | |
1808 | | - | |
| 1813 | + | |
| 1814 | + | |
1809 | 1815 | | |
1810 | 1816 | | |
1811 | 1817 | | |
1812 | 1818 | | |
1813 | 1819 | | |
1814 | 1820 | | |
1815 | | - | |
1816 | | - | |
| 1821 | + | |
| 1822 | + | |
1817 | 1823 | | |
1818 | 1824 | | |
1819 | 1825 | | |
| |||
0 commit comments