public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (applesmc) Fix smc_sane() function
@ 2020-11-17  7:24 Dan Carpenter
  2020-11-17  9:25 ` Brad Campbell
  2020-11-17  9:58 ` Brad Campbell
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-11-17  7:24 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Jean Delvare, Guenter Roeck, Brad Campbell, linux-hwmon,
	kernel-janitors

This test is reversed so the function will return without sending
the APPLESMC_READ_CMD or completing the rest of the function.

Fixes: 4d64bb4ba5ec ("hwmon: (applesmc) Re-work SMC comms")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/hwmon/applesmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 79b498f816fe..289b39537683 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -227,7 +227,7 @@ static int smc_sane(void)
 	int ret;
 
 	ret = wait_status(0, SMC_STATUS_BUSY);
-	if (!ret)
+	if (ret)
 		return ret;
 	ret = send_command(APPLESMC_READ_CMD);
 	if (ret)
-- 
2.29.2


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

end of thread, other threads:[~2020-11-17 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-17  7:24 [PATCH] hwmon: (applesmc) Fix smc_sane() function Dan Carpenter
2020-11-17  9:25 ` Brad Campbell
2020-11-17  9:58 ` Brad Campbell
2020-11-17 14:02   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox