From: Dan Carpenter <dan.carpenter@oracle.com>
To: Beniamin Bia <beniamin.bia@analog.com>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] hwmon: (adm1177) Fix adm1177_write_alert_thr()
Date: Tue, 14 Jan 2020 08:51:25 +0300 [thread overview]
Message-ID: <20200114055125.ro5slro6zewr56tx@kili.mountain> (raw)
There is a reversed condition so the adm1177_write_alert_thr() function
doesn't update "st->alert_threshold_ua".
Fixes: 829091f9c56c ("hwmon: (adm1177) Add ADM1177 Hot Swap Controller and Digital Power Monitor driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/hwmon/adm1177.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/adm1177.c b/drivers/hwmon/adm1177.c
index 1f2ff7a29306..d314223a404a 100644
--- a/drivers/hwmon/adm1177.c
+++ b/drivers/hwmon/adm1177.c
@@ -63,7 +63,7 @@ static int adm1177_write_alert_thr(struct adm1177_state *st,
ret = i2c_smbus_write_byte_data(st->client, ADM1177_REG_ALERT_TH,
val);
- if (!ret)
+ if (ret)
return ret;
st->alert_threshold_ua = alert_threshold_ua;
--
2.11.0
next reply other threads:[~2020-01-14 5:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 5:51 Dan Carpenter [this message]
2020-01-14 14:12 ` [PATCH] hwmon: (adm1177) Fix adm1177_write_alert_thr() Guenter Roeck
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=20200114055125.ro5slro6zewr56tx@kili.mountain \
--to=dan.carpenter@oracle.com \
--cc=Michael.Hennerich@analog.com \
--cc=beniamin.bia@analog.com \
--cc=jdelvare@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/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;
as well as URLs for NNTP newsgroup(s).