hwmon patches for 3.4-rc5
Fix build warning in ad7314 driver Fix pci_device_id array access in fam15h_power driver, introduced by00250ec
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJPmsD0AAoJEMsfJm/On5mBmxQP/1M4cipJhnCvxMnNuP/pMGa+ Mo6GsqRgR8eVS7q0WWVRY194n2zUaK2kDtkhFla6QnIZ3D7C/tPEJKKkyIonIMbK nyiH2qrUENrVmOW2FT8oFQ070s/VWRv9zibZpRtpKWmV7rkLkHBBNMpGPLFTne4B 7XTB/0HXGatQc2iQVqyssxIKOL5yPlHjI1iwNEjC6zQmFf5wggcZnNwmxPoENOD7 GHl3xpp3j/X1Lsrh0WSvDVPmIaYce2a2G+ElBypoEfp2uLRbn5emLvBVqcib0oNm oi80TH+TO+IzP3v5BQAjpKB1eK7jZ9w6FNzxe1GVSWL03WfrHi5g4UMyVH0p5mP7 CNBH2o3qdVvidBCZPU+f9S6m7/AJaWU1zMXHztsBlHoDRHUPdhqOuDov4QEjl9pa AxxIQtv8mIjM/u4dAa+QnaNS/kwm/DjoIw1bn7f6duIgj12U8Aqbqnyp4Uq0deNg w3tRGGcrwqfCRa7v+UDrvy40RoixY1M8/2ibf9PnEYV7Ibkp1aX0vA34RDcxXCWI mtNB601uAN0s9L+H0uGpMDRkWww84UkgV+RWSXw3WT5TMyMRn86T02Txw2UDKDrk D2YK+QVR2zT2blmgXQ0o+lqpttvOK51P8foWeNrSR39MkS6W0nZULko0IxgD/Swr rb6o/CkqHVbtYudnWVMq =jK+n -----END PGP SIGNATURE----- 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 commit00250ec909
("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
This commit is contained in:
commit
9f7e2f9037
|
@ -47,7 +47,7 @@ struct ad7314_data {
|
|||
u16 rx ____cacheline_aligned;
|
||||
};
|
||||
|
||||
static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
|
||||
static int ad7314_spi_read(struct ad7314_data *chip)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -57,9 +57,7 @@ static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
|
|||
return ret;
|
||||
}
|
||||
|
||||
*data = be16_to_cpu(chip->rx);
|
||||
|
||||
return ret;
|
||||
return be16_to_cpu(chip->rx);
|
||||
}
|
||||
|
||||
static ssize_t ad7314_show_temperature(struct device *dev,
|
||||
|
@ -70,12 +68,12 @@ static ssize_t ad7314_show_temperature(struct device *dev,
|
|||
s16 data;
|
||||
int ret;
|
||||
|
||||
ret = ad7314_spi_read(chip, &data);
|
||||
ret = ad7314_spi_read(chip);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
switch (spi_get_device_id(chip->spi_dev)->driver_data) {
|
||||
case ad7314:
|
||||
data = (data & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
|
||||
data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
|
||||
data = (data << 6) >> 6;
|
||||
|
||||
return sprintf(buf, "%d\n", 250 * data);
|
||||
|
@ -86,7 +84,7 @@ static ssize_t ad7314_show_temperature(struct device *dev,
|
|||
* with a sign bit - which is a 14 bit 2's complement
|
||||
* register. 1lsb - 31.25 milli degrees centigrade
|
||||
*/
|
||||
data &= ADT7301_TEMP_MASK;
|
||||
data = ret & ADT7301_TEMP_MASK;
|
||||
data = (data << 2) >> 2;
|
||||
|
||||
return sprintf(buf, "%d\n",
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue