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