Commit b88c5049 authored by Lei YU's avatar Lei YU Committed by Guenter Roeck

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.

Cc: stable@vger.kernel.org
Fixes: df04ced6 ("hwmon (occ): Add sysfs attributes for additional OCC data")
Signed-off-by: default avatarLei YU <mine260309@gmail.com>
Reviewed-by: default avatarEddie James <eajames@linux.ibm.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 53f1647d
...@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev, ...@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
val = !!(header->status & OCC_STAT_ACTIVE); val = !!(header->status & OCC_STAT_ACTIVE);
break; break;
case 2: case 2:
val = !!(header->status & OCC_EXT_STAT_DVFS_OT); val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
break; break;
case 3: case 3:
val = !!(header->status & OCC_EXT_STAT_DVFS_POWER); val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
break; break;
case 4: case 4:
val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE); val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
break; break;
case 5: case 5:
val = !!(header->status & OCC_EXT_STAT_QUICK_DROP); val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
break; break;
case 6: case 6:
val = header->occ_state; val = header->occ_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment