diff options
author | Vadim Pasternak <vadimp@nvidia.com> | 2021-08-23 17:45:01 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-10-04 21:56:13 +0200 |
commit | 52f57396c75acd77ebcdf3d20aed24ed248e9f79 (patch) | |
tree | fafe159d12f1e666ea0de3e982f8e4c27f80200a /drivers/i2c | |
parent | 3bce7703c7ba648bd9e174dc1413f422b7998833 (diff) | |
download | linux-52f57396c75acd77ebcdf3d20aed24ed248e9f79.tar.bz2 |
i2c: mlxcpld: Fix criteria for frequency setting
Value for getting frequency capability wrongly has been taken from
register offset instead of register value.
Fixes: 66b0c2846ba8 ("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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-mlxcpld.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c index 4e0b7c2882ce..6d41c3db8a2b 100644 --- a/drivers/i2c/busses/i2c-mlxcpld.c +++ b/drivers/i2c/busses/i2c-mlxcpld.c @@ -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; |