public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Vadim Pasternak <vadimp@nvidia.com>
To: <wsa@the-dreams.de>
Cc: <peda@axentia.se>, <linux-hwmon@vger.kernel.org>,
	Vadim Pasternak <vadimp@nvidia.com>
Subject: [PATCH i2c-next 1/4] i2c: mlxcpld: Fix criteria for frequency setting
Date: Mon, 16 Aug 2021 21:16:12 +0300	[thread overview]
Message-ID: <20210816181615.2625662-2-vadimp@nvidia.com> (raw)
In-Reply-To: <20210816181615.2625662-1-vadimp@nvidia.com>

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>
---
 drivers/i2c/busses/i2c-mlxcpld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.20.1


  reply	other threads:[~2021-08-16 18:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 18:16 [PATCH i2c-next 0/4] i2c: mlxcpld: Add fixes and features for transaction polling time setting Vadim Pasternak
2021-08-16 18:16 ` Vadim Pasternak [this message]
2021-08-16 18:16 ` [PATCH i2c-next 2/4] i2c: mlxcpld: Modify register setting for 400KHz frequency Vadim Pasternak
2021-08-16 18:16 ` [PATCH i2c-next 3/4] i2c: mlxcpld: Reduce polling time for performance improvement Vadim Pasternak
2021-08-16 18:16 ` [PATCH i2c-next 4/4] i2c: mlxcpld: Allow flexible polling time setting for I2C transactions Vadim Pasternak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210816181615.2625662-2-vadimp@nvidia.com \
    --to=vadimp@nvidia.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox