]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
i2c: testunit: don't erase registers after STOP
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 27 Jun 2024 11:14:47 +0000 (13:14 +0200)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 28 Jun 2024 18:44:34 +0000 (20:44 +0200)
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: b39ab96aa894 ("i2c: testunit: add support for block process calls")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/i2c-slave-testunit.c

index a49642bbae4b7077f7fa3af34f9423d6dba58045..a5dcbc3c2c141a70ea6ac5d5df9df7a4cf002244 100644 (file)
@@ -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);