power: supply: sbs-message: double left shift bug in sbsm_select()

The original code does this: "1 << (1 << 11)" which is undefined in C.

Fixes: dbc4deda03 ("power: Adds support for Smart Battery System Manager")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
Dan Carpenter 2017-11-07 15:43:22 +03:00 committed by Sebastian Reichel
parent 4fbd8d194f
commit 7d54d0d38e
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ static int sbsm_select(struct i2c_mux_core *muxc, u32 chan)
return ret; return ret;
/* chan goes from 1 ... 4 */ /* chan goes from 1 ... 4 */
reg = 1 << BIT(SBSM_SMB_BAT_OFFSET + chan); reg = BIT(SBSM_SMB_BAT_OFFSET + chan);
ret = sbsm_write_word(data->client, SBSM_CMD_BATSYSSTATE, reg); ret = sbsm_write_word(data->client, SBSM_CMD_BATSYSSTATE, reg);
if (ret) if (ret)
dev_err(dev, "Failed to select channel %i\n", chan); dev_err(dev, "Failed to select channel %i\n", chan);