hwmon: (fam15h_power) Fix pci_device_id array
authorGuenter Roeck <guenter.roeck@ericsson.com>
Wed, 25 Apr 2012 20:44:20 +0000 (13:44 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Thu, 26 Apr 2012 15:40:08 +0000 (08:40 -0700)
pci_match_id() takes an *array* of IDs which must be properly zero-
terminated.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org # 3.0+: 00250ec hwmon: fam15h_power: fix bogus values
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/fam15h_power.c

index 37a8fc92b44acf50a16d086c9983a9794c03b838..e8e18cab1fb8c34d63c259a64afb461833df8be7 100644 (file)
@@ -128,17 +128,20 @@ static bool __devinit fam15h_power_is_internal_node0(struct pci_dev *f4)
  * counter saturations resulting in bogus power readings.
  * We correct this value ourselves to cope with older BIOSes.
  */
+static DEFINE_PCI_DEVICE_TABLE(affected_device) = {
+       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
+       { 0 }
+};
+
 static void __devinit tweak_runavg_range(struct pci_dev *pdev)
 {
        u32 val;
-       const struct pci_device_id affected_device = {
-               PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) };
 
        /*
         * let this quirk apply only to the current version of the
         * northbridge, since future versions may change the behavior
         */
-       if (!pci_match_id(&affected_device, pdev))
+       if (!pci_match_id(affected_device, pdev))
                return;
 
        pci_bus_read_config_dword(pdev->bus,