History

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

Linus Torvalds committed 14 years ago

Commit 9f7e2f92 parents a882a4d c3e40a92 files · +11 −10Browse files

Unified · Split

2 files
  1. drivers/hwmon/ad7314.c +5 −7
  2. drivers/hwmon/fam15h_power.c +6 −3
drivers/hwmon/ad7314.c+5−7
@@ -47,7 +47,7 @@ struct ad7314_data { · 46 unmodified lines
4747 u16 rx ____cacheline_aligned;
4848 };
4949
50−static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
50+static int ad7314_spi_read(struct ad7314_data *chip)
5151 {
5252 int ret;
5353
@@ -57,9 +57,7 @@ static int ad7314_spi_read(struct ad7314_data *chip, s16 *data) · 3 unmodified lines
5757 return ret;
5858 }
5959
60− *data = be16_to_cpu(chip->rx);
61−
62− return ret;
60+ return be16_to_cpu(chip->rx);
6361 }
6462
6563 static ssize_t ad7314_show_temperature(struct device *dev,
@@ -70,12 +68,12 @@ static ssize_t ad7314_show_temperature(struct device *dev, · 4 unmodified lines
7068 s16 data;
7169 int ret;
7270
73− ret = ad7314_spi_read(chip, &data);
71+ ret = ad7314_spi_read(chip);
7472 if (ret < 0)
7573 return ret;
7674 switch (spi_get_device_id(chip->spi_dev)->driver_data) {
7775 case ad7314:
78− data = (data & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
76+ data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
7977 data = (data << 6) >> 6;
8078
8179 return sprintf(buf, "%d\n", 250 * data);
@@ -86,7 +84,7 @@ static ssize_t ad7314_show_temperature(struct device *dev, · 4 unmodified lines
8684 * with a sign bit - which is a 14 bit 2's complement
8785 * register. 1lsb - 31.25 milli degrees centigrade
8886 */
89− data &= ADT7301_TEMP_MASK;
87+ data = ret & ADT7301_TEMP_MASK;
9088 data = (data << 2) >> 2;
9189
9290 return sprintf(buf, "%d\n",
drivers/hwmon/fam15h_power.c+6−3
@@ -128,17 +128,20 @@ static bool __devinit fam15h_power_is_internal_node0(struct pci_dev *f4) · 127 unmodified lines
128128 * counter saturations resulting in bogus power readings.
129129 * We correct this value ourselves to cope with older BIOSes.
130130 */
131+static DEFINE_PCI_DEVICE_TABLE(affected_device) = {
132+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
133+ { 0 }
134+};
135+
131136 static void __devinit tweak_runavg_range(struct pci_dev *pdev)
132137 {
133138 u32 val;
134− const struct pci_device_id affected_device = {
135− PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) };
136139
137140 /*
138141 * let this quirk apply only to the current version of the
139142 * northbridge, since future versions may change the behavior
140143 */
141− if (!pci_match_id(&affected_device, pdev))
144+ if (!pci_match_id(affected_device, pdev))
142145 return;
143146
144147 pci_bus_read_config_dword(pdev->bus,