Commit 52f57396 authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Wolfram Sang

i2c: mlxcpld: Fix criteria for frequency setting

Value for getting frequency capability wrongly has been taken from
register offset instead of register value.

Fixes: 66b0c284 ("i2c: mlxcpld: Add support for I2C bus frequency setting")
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 3bce7703
......@@ -495,7 +495,7 @@ mlxcpld_i2c_set_frequency(struct mlxcpld_i2c_priv *priv,
return err;
/* Set frequency only if it is not 100KHz, which is default. */
switch ((data->reg & data->mask) >> data->bit) {
switch ((regval & data->mask) >> data->bit) {
case MLXCPLD_I2C_FREQ_1000KHZ:
freq = MLXCPLD_I2C_FREQ_1000KHZ_SET;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment