Commit e6e25bba authored by Guenter Roeck's avatar Guenter Roeck Committed by Jeff Kirsher

igb: Start temperature sensor attribute index with 1

Per hwmon ABI, temperature sensor attribute index starts with 1, not 0.
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarJean Delvare <khali@linux-fr.org>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent e3670b81
...@@ -124,22 +124,22 @@ static int igb_add_hwmon_attr(struct igb_adapter *adapter, ...@@ -124,22 +124,22 @@ static int igb_add_hwmon_attr(struct igb_adapter *adapter,
case IGB_HWMON_TYPE_LOC: case IGB_HWMON_TYPE_LOC:
igb_attr->dev_attr.show = igb_hwmon_show_location; igb_attr->dev_attr.show = igb_hwmon_show_location;
snprintf(igb_attr->name, sizeof(igb_attr->name), snprintf(igb_attr->name, sizeof(igb_attr->name),
"temp%u_label", offset); "temp%u_label", offset + 1);
break; break;
case IGB_HWMON_TYPE_TEMP: case IGB_HWMON_TYPE_TEMP:
igb_attr->dev_attr.show = igb_hwmon_show_temp; igb_attr->dev_attr.show = igb_hwmon_show_temp;
snprintf(igb_attr->name, sizeof(igb_attr->name), snprintf(igb_attr->name, sizeof(igb_attr->name),
"temp%u_input", offset); "temp%u_input", offset + 1);
break; break;
case IGB_HWMON_TYPE_CAUTION: case IGB_HWMON_TYPE_CAUTION:
igb_attr->dev_attr.show = igb_hwmon_show_cautionthresh; igb_attr->dev_attr.show = igb_hwmon_show_cautionthresh;
snprintf(igb_attr->name, sizeof(igb_attr->name), snprintf(igb_attr->name, sizeof(igb_attr->name),
"temp%u_max", offset); "temp%u_max", offset + 1);
break; break;
case IGB_HWMON_TYPE_MAX: case IGB_HWMON_TYPE_MAX:
igb_attr->dev_attr.show = igb_hwmon_show_maxopthresh; igb_attr->dev_attr.show = igb_hwmon_show_maxopthresh;
snprintf(igb_attr->name, sizeof(igb_attr->name), snprintf(igb_attr->name, sizeof(igb_attr->name),
"temp%u_crit", offset); "temp%u_crit", offset + 1);
break; break;
default: default:
rc = -EPERM; rc = -EPERM;
......
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