summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-brcmstb.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2021-02-25 17:11:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-04 10:26:39 +0100
commit8450b1cd7cb3292ec2df24300269bcbc4855e794 (patch)
tree7deca1c7d9eac612a8c27989a75f56f73e2f7175 /drivers/i2c/busses/i2c-brcmstb.c
parent1a47856548fb4801ee936e4f30ec1613f4b444cb (diff)
i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
[ Upstream commit a1858ce0cfe31368b23ba55794e409fb57ced4a4 ] 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: dd1aa2524bc5 ("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>
Diffstat (limited to 'drivers/i2c/busses/i2c-brcmstb.c')
-rw-r--r--drivers/i2c/busses/i2c-brcmstb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 506991596b68..5e89cd6b690c 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -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",