Commit 9f7e2f9037ffa03f4c4cd6f19159a367e4e02f44

Authored by Linus Torvalds

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon patches from Guenter Roeck:
 - Fix build warning in ad7314 driver
 - Fix pci_device_id array access in fam15h_power driver, introduced by
   commit 00250ec90963 ("hwmon: fam15h_power: fix bogus values with
   current BIOSes")

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (fam15h_power) Fix pci_device_id array
  hwmon: (ad7314) Fix build warning

Showing 2 changed files Side-by-side Diff

drivers/hwmon/ad7314.c
... ... @@ -47,7 +47,7 @@
47 47 u16 rx ____cacheline_aligned;
48 48 };
49 49  
50   -static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
  50 +static int ad7314_spi_read(struct ad7314_data *chip)
51 51 {
52 52 int ret;
53 53  
... ... @@ -57,9 +57,7 @@
57 57 return ret;
58 58 }
59 59  
60   - *data = be16_to_cpu(chip->rx);
61   -
62   - return ret;
  60 + return be16_to_cpu(chip->rx);
63 61 }
64 62  
65 63 static ssize_t ad7314_show_temperature(struct device *dev,
66 64  
... ... @@ -70,12 +68,12 @@
70 68 s16 data;
71 69 int ret;
72 70  
73   - ret = ad7314_spi_read(chip, &data);
  71 + ret = ad7314_spi_read(chip);
74 72 if (ret < 0)
75 73 return ret;
76 74 switch (spi_get_device_id(chip->spi_dev)->driver_data) {
77 75 case ad7314:
78   - data = (data & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
  76 + data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
79 77 data = (data << 6) >> 6;
80 78  
81 79 return sprintf(buf, "%d\n", 250 * data);
... ... @@ -86,7 +84,7 @@
86 84 * with a sign bit - which is a 14 bit 2's complement
87 85 * register. 1lsb - 31.25 milli degrees centigrade
88 86 */
89   - data &= ADT7301_TEMP_MASK;
  87 + data = ret & ADT7301_TEMP_MASK;
90 88 data = (data << 2) >> 2;
91 89  
92 90 return sprintf(buf, "%d\n",
drivers/hwmon/fam15h_power.c
... ... @@ -128,17 +128,20 @@
128 128 * counter saturations resulting in bogus power readings.
129 129 * We correct this value ourselves to cope with older BIOSes.
130 130 */
  131 +static DEFINE_PCI_DEVICE_TABLE(affected_device) = {
  132 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
  133 + { 0 }
  134 +};
  135 +
131 136 static void __devinit tweak_runavg_range(struct pci_dev *pdev)
132 137 {
133 138 u32 val;
134   - const struct pci_device_id affected_device = {
135   - PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) };
136 139  
137 140 /*
138 141 * let this quirk apply only to the current version of the
139 142 * northbridge, since future versions may change the behavior
140 143 */
141   - if (!pci_match_id(&affected_device, pdev))
  144 + if (!pci_match_id(affected_device, pdev))
142 145 return;
143 146  
144 147 pci_bus_read_config_dword(pdev->bus,