linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: (adm1177) Fix adm1177_write_alert_thr()
@ 2020-01-14  5:51 Dan Carpenter
  2020-01-14 14:12 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-01-14  5:51 UTC (permalink / raw)
  To: Beniamin Bia
  Cc: Michael Hennerich, Jean Delvare, Guenter Roeck, linux-hwmon,
	kernel-janitors

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-14 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14  5:51 [PATCH] hwmon: (adm1177) Fix adm1177_write_alert_thr() Dan Carpenter
2020-01-14 14:12 ` Guenter Roeck

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).