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

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
MAINTAINERS: hwmon/coretemp: Change maintainers
hwmon: (k8temp) Differentiate between AM2 and ASB1
hwmon: (ads7871) Fix ads7871_probe error paths
hwmon: (coretemp) Fix harmless build warning

+52 -25
+1 -2
MAINTAINERS
··· 1676 F: mm/*cgroup* 1677 1678 CORETEMP HARDWARE MONITORING DRIVER 1679 - M: Rudolf Marek <r.marek@assembler.cz> 1680 - M: Huaxu Wan <huaxu.wan@intel.com> 1681 L: lm-sensors@lm-sensors.org 1682 S: Maintained 1683 F: Documentation/hwmon/coretemp
··· 1676 F: mm/*cgroup* 1677 1678 CORETEMP HARDWARE MONITORING DRIVER 1679 + M: Fenghua Yu <fenghua.yu@intel.com> 1680 L: lm-sensors@lm-sensors.org 1681 S: Maintained 1682 F: Documentation/hwmon/coretemp
+19 -19
drivers/hwmon/ads7871.c
··· 160 161 static int __devinit ads7871_probe(struct spi_device *spi) 162 { 163 - int status, ret, err = 0; 164 uint8_t val; 165 struct ads7871_data *pdata; 166 167 dev_dbg(&spi->dev, "probe\n"); 168 - 169 - pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL); 170 - if (!pdata) { 171 - err = -ENOMEM; 172 - goto exit; 173 - } 174 - 175 - status = sysfs_create_group(&spi->dev.kobj, &ads7871_group); 176 - if (status < 0) 177 - goto error_free; 178 - 179 - pdata->hwmon_dev = hwmon_device_register(&spi->dev); 180 - if (IS_ERR(pdata->hwmon_dev)) { 181 - err = PTR_ERR(pdata->hwmon_dev); 182 - goto error_remove; 183 - } 184 - 185 - spi_set_drvdata(spi, pdata); 186 187 /* Configure the SPI bus */ 188 spi->mode = (SPI_MODE_0); ··· 183 we need to make sure we really have a chip*/ 184 if (val != ret) { 185 err = -ENODEV; 186 goto error_remove; 187 } 188
··· 160 161 static int __devinit ads7871_probe(struct spi_device *spi) 162 { 163 + int ret, err; 164 uint8_t val; 165 struct ads7871_data *pdata; 166 167 dev_dbg(&spi->dev, "probe\n"); 168 169 /* Configure the SPI bus */ 170 spi->mode = (SPI_MODE_0); ··· 201 we need to make sure we really have a chip*/ 202 if (val != ret) { 203 err = -ENODEV; 204 + goto exit; 205 + } 206 + 207 + pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL); 208 + if (!pdata) { 209 + err = -ENOMEM; 210 + goto exit; 211 + } 212 + 213 + err = sysfs_create_group(&spi->dev.kobj, &ads7871_group); 214 + if (err < 0) 215 + goto error_free; 216 + 217 + spi_set_drvdata(spi, pdata); 218 + 219 + pdata->hwmon_dev = hwmon_device_register(&spi->dev); 220 + if (IS_ERR(pdata->hwmon_dev)) { 221 + err = PTR_ERR(pdata->hwmon_dev); 222 goto error_remove; 223 } 224
-1
drivers/hwmon/coretemp.c
··· 518 static int __init coretemp_init(void) 519 { 520 int i, err = -ENODEV; 521 - struct pdev_entry *p, *n; 522 523 /* quick check if we run Intel */ 524 if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL)
··· 518 static int __init coretemp_init(void) 519 { 520 int i, err = -ENODEV; 521 522 /* quick check if we run Intel */ 523 if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL)
+32 -3
drivers/hwmon/k8temp.c
··· 143 144 MODULE_DEVICE_TABLE(pci, k8temp_ids); 145 146 static int __devinit k8temp_probe(struct pci_dev *pdev, 147 const struct pci_device_id *id) 148 { ··· 210 "wrong - check erratum #141\n"); 211 } 212 213 - if ((model >= 0x69) && 214 - !(model == 0xc1 || model == 0x6c || model == 0x7c || 215 - model == 0x6b || model == 0x6f || model == 0x7f)) { 216 /* 217 * RevG desktop CPUs (i.e. no socket S1G1 or 218 * ASB1 parts) need additional offset,
··· 143 144 MODULE_DEVICE_TABLE(pci, k8temp_ids); 145 146 + static int __devinit is_rev_g_desktop(u8 model) 147 + { 148 + u32 brandidx; 149 + 150 + if (model < 0x69) 151 + return 0; 152 + 153 + if (model == 0xc1 || model == 0x6c || model == 0x7c) 154 + return 0; 155 + 156 + /* 157 + * Differentiate between AM2 and ASB1. 158 + * See "Constructing the processor Name String" in "Revision 159 + * Guide for AMD NPT Family 0Fh Processors" (33610). 160 + */ 161 + brandidx = cpuid_ebx(0x80000001); 162 + brandidx = (brandidx >> 9) & 0x1f; 163 + 164 + /* Single core */ 165 + if ((model == 0x6f || model == 0x7f) && 166 + (brandidx == 0x7 || brandidx == 0x9 || brandidx == 0xc)) 167 + return 0; 168 + 169 + /* Dual core */ 170 + if (model == 0x6b && 171 + (brandidx == 0xb || brandidx == 0xc)) 172 + return 0; 173 + 174 + return 1; 175 + } 176 + 177 static int __devinit k8temp_probe(struct pci_dev *pdev, 178 const struct pci_device_id *id) 179 { ··· 179 "wrong - check erratum #141\n"); 180 } 181 182 + if (is_rev_g_desktop(model)) { 183 /* 184 * RevG desktop CPUs (i.e. no socket S1G1 or 185 * ASB1 parts) need additional offset,