Skip to content

Commit

Permalink
i2c: testunit: don't erase registers after STOP
Browse files Browse the repository at this point in the history
STOP fallsthrough to WRITE_REQUESTED but this became problematic when
clearing the testunit registers was added to the latter. Actually, there
is no reason to clear the testunit state after STOP. Doing it when a new
WRITE_REQUESTED arrives is enough. So, no need to fallthrough, at all.

Fixes: b39ab96 ("i2c: testunit: add support for block process calls")
Signed-off-by: Wolfram Sang <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
  • Loading branch information
Wolfram Sang committed Jun 28, 2024
1 parent 4e9a1a4 commit c422b6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/i2c-slave-testunit.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client,
queue_delayed_work(system_long_wq, &tu->worker,
msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY]));
}
fallthrough;
break;

case I2C_SLAVE_WRITE_REQUESTED:
memset(tu->regs, 0, TU_NUM_REGS);
Expand Down

0 comments on commit c422b6a

Please sign in to comment.