diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2024-08-06 11:45:37 +0200 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-09-10 00:33:54 +0200 |
commit | ab5bd055e4dbb849d5d77c9a6d908e6f3bed58ed (patch) | |
tree | fefd804249b08171bc14a4f433a7e25e831fa1cf | |
parent | i2c: don't use ',' after delimiters (diff) | |
download | linux-ab5bd055e4dbb849d5d77c9a6d908e6f3bed58ed.tar.xz linux-ab5bd055e4dbb849d5d77c9a6d908e6f3bed58ed.zip |
i2c: mt65xx: Avoid double initialization of restart_flag in isr
In the mtk_i2c_irq() handler, variable restart_flag is initialized
to zero and then reassigned with I2C_RS_TRANSFER if and only if
auto_restart is enabled.
Avoid a double initialization of this variable by transferring the
auto_restart check to the restart_flag declaration.
This commit brings no functional changes.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
-rw-r--r-- | drivers/i2c/busses/i2c-mt65xx.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index a8b5719c3372..e0ba653dec2d 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -1306,12 +1306,9 @@ err_exit: static irqreturn_t mtk_i2c_irq(int irqno, void *dev_id) { struct mtk_i2c *i2c = dev_id; - u16 restart_flag = 0; + u16 restart_flag = i2c->auto_restart ? I2C_RS_TRANSFER : 0; u16 intr_stat; - if (i2c->auto_restart) - restart_flag = I2C_RS_TRANSFER; - intr_stat = mtk_i2c_readw(i2c, OFFSET_INTR_STAT); mtk_i2c_writew(i2c, intr_stat, OFFSET_INTR_STAT); |