Skip to content

Commit

Permalink
i2c: mlxcpld: Fix criteria for frequency setting
Browse files Browse the repository at this point in the history
Value for getting frequency capability wrongly has been taken from
register offset instead of register value.

Fixes: 66b0c28 ("i2c: mlxcpld: Add support for I2C bus frequency setting")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Vadim Pasternak authored and Wolfram Sang committed Oct 4, 2021
1 parent 3bce770 commit 52f5739
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-mlxcpld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 52f5739

Please sign in to comment.