summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorYueyao Zhu <yueyao.zhu@gmail.com>2017-05-09 09:04:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-15 11:23:55 +0200
commitaac53ee4557947d778cb6a255c719e5c70963c42 (patch)
treefc3f99da69ce0c76bce00cdd3ddb2ac8d790bbbc /drivers/staging
parent227383f8c28ea9e53d958801790d0e2e8f985d08 (diff)
staging: typec: fusb302: Fix chip->vbus_present init value
FUSB_REG_STATUS0 & FUSB_REG_STATUS0_VBUSOK = 0x40 & 0x80 is always zero. Fix the code to what it is intended to be: check the VBUSOK bit of the value read from address FUSB_REG_STATUS0. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Yueyao Zhu <yueyao.zhu@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/typec/fusb302/fusb302.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index aa460f93a293..d8b50b49bb2d 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -489,7 +489,7 @@ static int tcpm_init(struct tcpc_dev *dev)
ret = fusb302_i2c_read(chip, FUSB_REG_STATUS0, &data);
if (ret < 0)
return ret;
- chip->vbus_present = !!(FUSB_REG_STATUS0 & FUSB_REG_STATUS0_VBUSOK);
+ chip->vbus_present = !!(data & FUSB_REG_STATUS0_VBUSOK);
ret = fusb302_i2c_read(chip, FUSB_REG_DEVICE_ID, &data);
if (ret < 0)
return ret;