Skip to content

Commit add0362

Browse files
author
Wolfram Sang
committed
i2c: testunit: sort case blocks
Because a 'fallthrough' was refactored away, the order of 'case' statements can be sorted better now to ease understanding the flow of events. Signed-off-by: Wolfram Sang <[email protected]>
1 parent 7c626ce commit add0362

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/i2c/i2c-slave-testunit.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client,
9494
int ret = 0;
9595

9696
switch (event) {
97+
case I2C_SLAVE_WRITE_REQUESTED:
98+
if (test_bit(TU_FLAG_IN_PROCESS, &tu->flags))
99+
return -EBUSY;
100+
101+
memset(tu->regs, 0, TU_NUM_REGS);
102+
tu->reg_idx = 0;
103+
break;
104+
97105
case I2C_SLAVE_WRITE_RECEIVED:
98106
if (test_bit(TU_FLAG_IN_PROCESS, &tu->flags))
99107
return -EBUSY;
@@ -127,14 +135,6 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client,
127135
tu->reg_idx = 0;
128136
break;
129137

130-
case I2C_SLAVE_WRITE_REQUESTED:
131-
if (test_bit(TU_FLAG_IN_PROCESS, &tu->flags))
132-
return -EBUSY;
133-
134-
memset(tu->regs, 0, TU_NUM_REGS);
135-
tu->reg_idx = 0;
136-
break;
137-
138138
case I2C_SLAVE_READ_PROCESSED:
139139
if (is_proc_call && tu->regs[TU_REG_DATAH])
140140
tu->regs[TU_REG_DATAH]--;

0 commit comments

Comments
 (0)