i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
Subsystems (3)
PATCH 1/1 i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
The brcmstb_send_i2c_cmd currently has a condition that is (CMD_RD || CMD_WR) which always evaluates to true, while the obvious fix is to test whether the cmd variable passed as parameter holds one of these two values.
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-brcmstb.c +1 -1
@@ -316,7 +316,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev, goto cmd_out; } -if ((CMD_RD ||CMD_WR ) && +if ((cmd ==CMD_RD || cmd ==CMD_WR ) &&bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK ) { rc = -EREMOTEIO ; dev_dbg(dev->device, "controller received NOACK intr for %s\n",
Signature · 1 line
2.29.2
Quoted 7 lines · Maxime Ripard
The
brcmstb_send_i2c_cmdcurrently has a condition that is (CMD_RD||CMD_WR) which always evaluates to true, while the obvious fix is to test whether the cmd variable passed as parameter holds one of these two values.Reported-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
controller driver")
Thanks!
Signature · 1 line
Florian
Quoted 7 lines · Maxime Ripard
The
brcmstb_send_i2c_cmdcurrently has a condition that is (CMD_RD||CMD_WR) which always evaluates to true, while the obvious fix is to test whether the cmd variable passed as parameter holds one of these two values.Reported-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
I got a feeling of deja vu...
... and, in deed, I already fixed this, too, one year ago:
http://patchwork.ozlabs.org/project/linux-i2c/patch/[email protected]/
Dunno why it never appeared in a pull request :(
I'll pick this one, now!
Wolfram Sang
AppliedQuoted 7 lines · Maxime Ripard
The
brcmstb_send_i2c_cmdcurrently has a condition that is (CMD_RD||CMD_WR) which always evaluates to true, while the obvious fix is to test whether the cmd variable passed as parameter holds one of these two values.Reported-by Dave Stevenson <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Applied to for-current, thanks!