mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
[ Upstream commita1858ce0cf] 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. Fixes:dd1aa2524b("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b3fcbf957c
commit
f9a6414e4e
@@ -318,7 +318,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",
|
||||
|
||||
Reference in New Issue
Block a user