Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: recovery: rename variable for easier understanding

While refactoring the routine before, it occurred to me that this will
make the code much easier to understand.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Wolfram Sang and committed by
Wolfram Sang
f7ff75e2 4fe10de5

+7 -7
+7 -7
drivers/i2c/i2c-core-base.c
··· 185 185 int i2c_generic_scl_recovery(struct i2c_adapter *adap) 186 186 { 187 187 struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; 188 - int i = 0, val = 1, ret; 188 + int i = 0, scl = 1, ret; 189 189 190 190 if (bri->prepare_recovery) 191 191 bri->prepare_recovery(adap); 192 192 193 - bri->set_scl(adap, val); 193 + bri->set_scl(adap, scl); 194 194 if (bri->set_sda) 195 195 bri->set_sda(adap, 1); 196 196 ndelay(RECOVERY_NDELAY); ··· 199 199 * By this time SCL is high, as we need to give 9 falling-rising edges 200 200 */ 201 201 while (i++ < RECOVERY_CLK_CNT * 2) { 202 - if (val) { 202 + if (scl) { 203 203 /* SCL shouldn't be low here */ 204 204 if (!bri->get_scl(adap)) { 205 205 dev_err(&adap->dev, ··· 209 209 } 210 210 } 211 211 212 - val = !val; 213 - bri->set_scl(adap, val); 212 + scl = !scl; 213 + bri->set_scl(adap, scl); 214 214 215 215 /* 216 216 * If we can set SDA, we will always create STOP here to ensure ··· 220 220 */ 221 221 ndelay(RECOVERY_NDELAY / 2); 222 222 if (bri->set_sda) 223 - bri->set_sda(adap, val); 223 + bri->set_sda(adap, scl); 224 224 ndelay(RECOVERY_NDELAY / 2); 225 225 226 - if (val) { 226 + if (scl) { 227 227 ret = i2c_generic_bus_free(adap); 228 228 if (ret == 0) 229 229 break;