igb: Start temperature sensor attribute index with 1
authorGuenter Roeck <linux@roeck-us.net>
Tue, 26 Nov 2013 07:15:34 +0000 (07:15 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 10 Dec 2013 09:27:35 +0000 (01:27 -0800)
Per hwmon ABI, temperature sensor attribute index starts with 1, not 0.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_hwmon.c

index 2e7ef2d0711f5b49fade2394c5c3fc7fb320ebbb..e0af5bc616139bc6540577952175345053399dd1 100644 (file)
@@ -124,22 +124,22 @@ static int igb_add_hwmon_attr(struct igb_adapter *adapter,
        case IGB_HWMON_TYPE_LOC:
                igb_attr->dev_attr.show = igb_hwmon_show_location;
                snprintf(igb_attr->name, sizeof(igb_attr->name),
-                        "temp%u_label", offset);
+                        "temp%u_label", offset + 1);
                break;
        case IGB_HWMON_TYPE_TEMP:
                igb_attr->dev_attr.show = igb_hwmon_show_temp;
                snprintf(igb_attr->name, sizeof(igb_attr->name),
-                        "temp%u_input", offset);
+                        "temp%u_input", offset + 1);
                break;
        case IGB_HWMON_TYPE_CAUTION:
                igb_attr->dev_attr.show = igb_hwmon_show_cautionthresh;
                snprintf(igb_attr->name, sizeof(igb_attr->name),
-                        "temp%u_max", offset);
+                        "temp%u_max", offset + 1);
                break;
        case IGB_HWMON_TYPE_MAX:
                igb_attr->dev_attr.show = igb_hwmon_show_maxopthresh;
                snprintf(igb_attr->name, sizeof(igb_attr->name),
-                        "temp%u_crit", offset);
+                        "temp%u_crit", offset + 1);
                break;
        default:
                rc = -EPERM;