Commit 7b956e6
committed
i2c: imx: use guard to take spinlock
JIRA: https://issues.redhat.com/browse/RHEL-116101
commit 07e0e8e
Author: Troy Mitchell <troymitchell988@gmail.com>
Date: Sat May 31 14:57:26 2025 +0800
i2c: imx: use guard to take spinlock
Use guard to automatically release the lock after going out of scope
instead of calling it manually.
i2c_imx_slave_handle() can safely be entered with the lock held.
Refactored the i2c_imx_isr function so that i2c_imx_master_isr
does not participate in the guard scope
So Using scoped_guard simplifies the control flow
by ensuring consistent and automatic unlock,
which improves readability without affecting correctness.
Co-developed-by: Yongchao Jia <jyc0019@gmail.com>
Signed-off-by: Yongchao Jia <jyc0019@gmail.com>
Signed-off-by: Troy Mitchell <troymitchell988@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250531-i2c-imx-update-v4-1-bfad0c8fd45c@gmail.com
Signed-off-by: Jared Kangas <jkangas@redhat.com>1 parent f4fcf7f commit 7b956e6
1 file changed
+16
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
891 | 892 | | |
892 | 893 | | |
893 | 894 | | |
894 | | - | |
895 | 895 | | |
896 | | - | |
| 896 | + | |
| 897 | + | |
897 | 898 | | |
898 | 899 | | |
899 | 900 | | |
900 | | - | |
| 901 | + | |
901 | 902 | | |
902 | 903 | | |
903 | 904 | | |
| |||
1126 | 1127 | | |
1127 | 1128 | | |
1128 | 1129 | | |
1129 | | - | |
1130 | 1130 | | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1134 | 1137 | | |
1135 | | - | |
1136 | 1138 | | |
| 1139 | + | |
1137 | 1140 | | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1147 | 1145 | | |
1148 | 1146 | | |
1149 | | - | |
1150 | | - | |
1151 | 1147 | | |
1152 | | - | |
1153 | 1148 | | |
1154 | | - | |
| 1149 | + | |
1155 | 1150 | | |
1156 | 1151 | | |
1157 | 1152 | | |
| |||
0 commit comments