[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1555324640-152061-1-git-send-email-mine260309@gmail.com>
Date: Mon, 15 Apr 2019 18:37:20 +0800
From: Lei YU <mine260309@...il.com>
To: Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
Eddie James <eajames@...ux.ibm.com>,
Lei YU <mine260309@...il.com>, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Joel Stanley <joel@....id.au>, Andrew Jeffery <andrew@...id.au>
Subject: [PATCH] hwmon (occ): Fix extended status bits
The occ's extended status is checked and shown as sysfs attributes. But
the code was incorrectly checking the "status" bits.
Fix it by checking the "ext_status" bits.
Signed-off-by: Lei YU <mine260309@...il.com>
---
drivers/hwmon/occ/sysfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
index fe3d15e..a71ca94 100644
--- a/drivers/hwmon/occ/sysfs.c
+++ b/drivers/hwmon/occ/sysfs.c
@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
val = !!(header->status & OCC_STAT_ACTIVE);
break;
case 2:
- val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
+ val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
break;
case 3:
- val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
+ val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
break;
case 4:
- val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
+ val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
break;
case 5:
- val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
+ val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
break;
case 6:
val = header->occ_state;
--
2.7.4
Powered by blists - more mailing lists