aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAge
* hwmon: (it87) Preserve configuration register bits on initJean Delvare2012-07-12
| | | | | | | | | | | | We were accidentally losing one bit in the configuration register on device initialization. It was reported to freeze one specific system right away. Properly preserve all bits we don't explicitly want to change in order to prevent that. Reported-by: Stevie Trujillo <stevie.trujillo@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
* Merge branch 'x86-urgent-for-linus' of ↵Linus Torvalds2012-06-29
|\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingo Molnar. * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, cpufeature: Remove stray %s, add -w to mkcapflags.pl x86, cpufeature: Catch duplicate CPU feature strings x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERM x86: Fix kernel-doc warnings x86, compat: Use test_thread_flag(TIF_IA32) in compat signal delivery
| * x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERMH. Peter Anvin2012-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It makes sense to label "Digital Thermal Sensor" as "DTS", but unfortunately the string "dts" was already used for "Debug Store", and /proc/cpuinfo is a user space ABI. Therefore, rename this to "dtherm". This conflict went into mainline via the hwmon tree without any x86 maintainer ack, and without any kind of hint in the subject. a4659053 x86/hwmon: fix initialization of coretemp Reported-by: Jean Delvare <khali@linux-fr.org> Link: http://lkml.kernel.org/r/4FE34BCB.5050305@linux.intel.com Cc: Jan Beulich <JBeulich@suse.com> Cc: <stable@vger.kernel.org> v2.6.36..v3.4 Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | hwmon: Update my e-mail addressGuenter Roeck2012-06-25
| | | | | | | | | | | | | | My old e-mail address won't be valid for much longer. Time to update it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (applesmc) correct email address for Jesper JuhlJesper Juhl2012-06-25
| | | | | | | | | | | | | | | | I've not had a gmail address for years. This commit updates the address to my actual working one. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | Merge tag 'hwmon-for-linus' of ↵Linus Torvalds2012-06-21
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: "Two minor fixes in emc2103 and applesmc drivers." * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (emc2103) Fix use of an uninitilized variable in error case hwmon: (applesmc) Limit key length in warning messages
| * | hwmon: (emc2103) Fix use of an uninitilized variable in error caseGuenter Roeck2012-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix: emc2103.c: In function set_pwm_enable: emc2103.c:463:12: warning: conf_reg may be used uninitialized in this function by checking the return value from read_u8_from_i2c(). This fixes a real problem, as conf_reg is really uninitialized if read_u8_from_i2c returns an error. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
| * | hwmon: (applesmc) Limit key length in warning messagesHenrik Rydberg2012-06-18
| |/ | | | | | | | | | | | | | | | | | | Key lookups may call read_smc() with a fixed-length key string, and if the lookup fails, trailing stack content may appear in the kernel log. Fixed with this patch. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | hwmon: (coretemp) Drop needless initializationJean Delvare2012-06-17
| | | | | | | | | | | | | | The value is overridden a few lines later. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (coretemp) Improve support for TjMax detection on Atom CPUsGuenter Roeck2012-06-17
| | | | | | | | | | | | | | | | Atom CPUs don't have a register to retrieve TjMax. Detection so far was incomplete. Use the X86 model ID to improve it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (coretemp) Add support for Atom D2000 and N2000 series CPU modelsGuenter Roeck2012-06-17
| | | | | | | | | | | | | | | | | | | | Document the Atom series D2000 and N2000 (Cedar Trail) as being supported. List and set TjMax for those series. Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: "R, Durgadoss" <durgadoss.r@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (coretemp) Improve support of recent Atom CPU modelsJean Delvare2012-06-17
|/ | | | | | | | | | | | | Document the new Atom series (Tunnel Creek and Medfield) as being supported, and list TjMax for the Atom E600 series. Also enable the Atom tjmax heuristic for these Atom CPU models. Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Alexander Stein <alexander.stein@systec-electronic.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: "R, Durgadoss" <durgadoss.r@intel.com>
* hwmon/sch56xx: Depend on watchdog for watchdog core functionsHans de Goede2012-05-30
| | | | | | | | | Since the watchdog code in sch56xx-common now uses the watchdog core, the Kconfig entires for the sch5627 and sch5636 should depend on WATCHDOG being set. Also select the watchdog core when we select one of the drivers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sch56xx-common: set correct bits in register()Dan Carpenter2012-05-30
| | | | | | | | | | WDOG_NO_WAY_OUT (3) and WDOG_ACTIVE (0) are the bit numbers, not a mask. So "data->wddev.status |= WDOG_ACTIVE;" was intended to set bit zero but it is a no-op. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sch56xx-common: Add proper ref-counting of watchdog dataHans de Goede2012-05-30
| | | | | | | | This fixes referencing free-ed memory in the corner case where /dev/watchdog is open when the platform driver gets unbound from the platform device. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sch56xx: Remove unnecessary checks for register changesHans de Goede2012-05-30
| | | | | | | | | | Since the watchdog core keeps track of the watchdog's active state, start/stop will never get called when no changes are necessary. So we can remove the check for the output_enable register changing before writing it (which is an expensive operation). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sch56xx: Use watchdog coreHans de Goede2012-05-30
| | | | | | | | | | Convert sch56xx drivers to the generic watchdog core. Note this patch depends on the "watchdog: Add multiple device support" patch from Alan Cox. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* Merge tag 'hwmon-for-linus' of ↵Linus Torvalds2012-05-23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New driver for INA219 and INA226, added support for IT8782F and IT8783E/F to it87 driver, plus cleanups in a couple of drivers." * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (it87) Make temp3 attribute conditional for IT8782F hwmon: (it87) Convert to use devm_kzalloc and devm_request_region hwmon: INA219 and INA226 support hwmon: (it87) Create voltage attributes only if voltage is enabled hwmon: (ntc_thermistor) Fix checkpatch warning hwmon: (ntc_thermistor) Optimize and fix build warning hwmon: (ntc_thermistor) Return error code from hwmon_device_register hwmon: (ntc_thermistor) Convert to devm_kzalloc hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFT acpi_power_meter: clean up code around setup_attrs acpi_power_meter: drop meter_rw_attrs, use common meter_attrs acpi_power_meter: remove duplicate code between register_{ro,rw}_attrs acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things up acpi_power_meter: use the same struct {rw,ro}_sensor_template for both hwmon: use module_pci_driver hwmon: (it87) Add support for IT8782F and IT8783E/F
| * hwmon: (it87) Make temp3 attribute conditional for IT8782FGuenter Roeck2012-05-22
| | | | | | | | | | | | | | On IT8782F, temp3 is only supported if UART6 is disabled. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
| * hwmon: (it87) Convert to use devm_kzalloc and devm_request_regionGuenter Roeck2012-05-22
| | | | | | | | | | | | | | This makes the code a bit simpler and smaller. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
| * hwmon: INA219 and INA226 supportFelten, Lothar2012-05-22
| | | | | | | | | | | | | | | | | | Add support for the Texas Instruments INA219 and INA226 power monitors. Signed-off-by: Lothar Felten <l-felten@ti.com> [guenter.roeck@ericsson.com: formatting cleanup; check for smbus word data; select PGA=8 for INA219] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * hwmon: (it87) Create voltage attributes only if voltage is enabledGuenter Roeck2012-05-20
| | | | | | | | | | | | | | | | On IT8782F and IT8783F, some voltage input pins may be disabled. Don't create sysfs attribute files if that is the case. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
| * hwmon: (ntc_thermistor) Fix checkpatch warningGuenter Roeck2012-05-20
| | | | | | | | | | | | | | Fix checkpatch WARNING: quoted string split across lines Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
| * hwmon: (ntc_thermistor) Optimize and fix build warningGuenter Roeck2012-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following build warning is seen in some configurations: drivers/hwmon/ntc_thermistor.c: In function 'ntc_show_temp': drivers/hwmon/ntc_thermistor.c:293: warning: 'temp' may be used uninitialized in this function Fix the problem by re-arranging the code to overload return values with error codes, and by avoiding error returns whenever possible. Specifically, Simplify lookup_comp() to not return an error. Instead, return i_low == i_high if there is an exact match, or if the ohm value is outside the lookup table range. Modify get_temp_mC() to not return an error. Since it only returns an error after lookup_comp() returned an error, this is quite straightforward after above change. Separate ntc_thermistor_read() into a function to read the resistor value (which can return an error), and the call to get_temp_mC() which doesn't. Call the functions directly from ntc_show_temp(). Code was tested using a test program, comparing the result of the old and new versions of get_temp_mC() for resistor values between 0 and 2,000,000 ohm. As a side effect, this patch reduces code size by approximately 400 bytes on x86_64. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Donggeun Kim <dg77.kim@samsung.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
| * hwmon: (ntc_thermistor) Return error code from hwmon_device_registerGuenter Roeck2012-05-20
| | | | | | | | | | | | | | | | hwmon_device_register() never returns a NULL pointer in case of errors, but an error value. Use it. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
| * hwmon: (ntc_thermistor) Convert to devm_kzallocGuenter Roeck2012-05-20
| | | | | | | | | | | | | | This avoids memory leaks, and makes the code a bit simpler and smaller. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
| * hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFTGuenter Roeck2012-05-20
| | | | | | | | | | | | | | | | | | Remove unused defines AD7314_PD, AD7314_TEMP_SIGN, and ADT7301_TEMP_SIGN. Rename AD7314_TEMP_OFFSET to the more appropriate AD7314_TEMP_SHIFT. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Jean Delvare <khali@linux-fr.org>
| * acpi_power_meter: clean up code around setup_attrsKyle McMartin2012-05-20
| | | | | | | | | | | | | | | | We don't need to duplicate if (res) checks if we're always running one or the other. Signed-off-by: Kyle McMartin <kyle@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * acpi_power_meter: drop meter_rw_attrs, use common meter_attrsKyle McMartin2012-05-20
| | | | | | | | | | | | | | | | | | We always register these two together, so move meter_rw_attrs into meter_ro_attrs and use the same for both since we no longer have two register_attr paths. Signed-off-by: Kyle McMartin <kyle@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * acpi_power_meter: remove duplicate code between register_{ro,rw}_attrsKyle McMartin2012-05-20
| | | | | | | | | | | | | | | | Key off the attr->set method being present to set the sysfs attribute as writable. Signed-off-by: Kyle McMartin <kyle@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things upKyle McMartin2012-05-20
| | | | | | | | | | | | | | Similar to how we do PCI/USB device id structs. Signed-off-by: Kyle McMartin <kyle@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * acpi_power_meter: use the same struct {rw,ro}_sensor_template for bothKyle McMartin2012-05-20
| | | | | | | | | | | | | | | | We don't need both, when we can just key the read/write off of the presence of the .set member. Signed-off-by: Kyle McMartin <kyle@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * hwmon: use module_pci_driverAxel Lin2012-05-20
| | | | | | | | | | | | | | | | | | | | | | This patch converts the drivers in drivers/hwmon/* to use module_pci_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Andreas Herrmann <andreas.herrmann3@amd.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
| * hwmon: (it87) Add support for IT8782F and IT8783E/FGuenter Roeck2012-05-20
| | | | | | | | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
* | Merge branch 'for-linus' of ↵Linus Torvalds2012-05-22
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial updates from Jiri Kosina: "As usual, it's mostly typo fixes, redundant code elimination and some documentation updates." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits) edac, mips: don't change code that has been removed in edac/mips tree xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer lib: Change mail address of Oskar Schirmer net: Change mail address of Oskar Schirmer arm/m68k: Change mail address of Sebastian Hess i2c: Change mail address of Oskar Schirmer net: Fix tcp_build_and_update_options comment in struct tcp_sock atomic64_32.h: fix parameter naming mismatch Kconfig: replace "--- help ---" with "---help---" c2port: fix bogus Kconfig "default no" edac: Fix spelling errors. qla1280: Remove redundant NULL check before release_firmware() call remoteproc: remove redundant NULL check before release_firmware() qla2xxx: Remove redundant NULL check before release_firmware() call. aic94xx: Get rid of redundant NULL check before release_firmware() call tehuti: delete redundant NULL check before release_firmware() qlogic: get rid of a redundant test for NULL before call to release_firmware() bna: remove redundant NULL test before release_firmware() tg3: remove redundant NULL test before release_firmware() call typhoon: get rid of redundant conditional before all to release_firmware() ...
| * Fix typo in various Kconfig fileMasanari Iida2012-04-16
| | | | | | | | | | | | | | Correct spelling typo in various Kconfig file. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | hwmon: (coretemp) Increase CPU core limitGuenter Roeck2012-05-01
| | | | | | | | | | | | | | | | | | | | | | CPU core ID is used to index the core_data[] array. The core ID is, however, not sequential; 10-core CPUS can have a core ID as high as 25. Increase the limit to 32 to be able to deal with current CPUs. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@vger.kernel.org # 3.0+ Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: Durgadoss R <durgadoss.r@intel.com>
* | hwmon: (coretemp) fix oops on cpu unplugKirill A. Shutemov2012-05-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | coretemp tries to access core_data array beyond bounds on cpu unplug if core id of the cpu if more than NUM_REAL_CORES-1. BUG: unable to handle kernel NULL pointer dereference at 000000000000013c IP: [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp] PGD 673e5a067 PUD 66e9b3067 PMD 0 Oops: 0000 [#1] SMP CPU 79 Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 ip6_tables xt_state nf_conntrack coretemp crc32c_intel asix tpm_tis pcspkr usbnet iTCO_wdt i2c_i801 microcode mii joydev tpm i2c_core iTCO_vendor_support tpm_bios i7core_edac igb ioatdma edac_core dca megaraid_sas [last unloaded: oprofile] Pid: 3315, comm: set-cpus Tainted: G W 3.4.0-rc5+ #2 QCI QSSC-S4R/QSSC-S4R RIP: 0010:[<ffffffffa00159af>] [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp] RSP: 0018:ffff880472fb3d48 EFLAGS: 00010246 RAX: 0000000000000124 RBX: 0000000000000034 RCX: 00000000ffffffff RDX: 0000000000000000 RSI: 0000000000000046 RDI: 0000000000000246 RBP: ffff880472fb3d88 R08: ffff88077fcd36c0 R09: 0000000000000001 R10: ffffffff8184bc48 R11: 0000000000000000 R12: ffff880273095800 R13: 0000000000000013 R14: ffff8802730a1810 R15: 0000000000000000 FS: 00007f694a20f720(0000) GS:ffff88077fcc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 000000000000013c CR3: 000000067209b000 CR4: 00000000000007e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process set-cpus (pid: 3315, threadinfo ffff880472fb2000, task ffff880471fa0000) Stack: ffff880277b4c308 0000000000000003 ffff880472fb3d88 0000000000000005 0000000000000034 00000000ffffffd1 ffffffff81cadc70 ffff880472fb3e14 ffff880472fb3dc8 ffffffff8161f48d ffff880471fa0000 0000000000000034 Call Trace: [<ffffffff8161f48d>] notifier_call_chain+0x4d/0x70 [<ffffffff8107f1be>] __raw_notifier_call_chain+0xe/0x10 [<ffffffff81059d30>] __cpu_notify+0x20/0x40 [<ffffffff815fa251>] _cpu_down+0x81/0x270 [<ffffffff815fa477>] cpu_down+0x37/0x50 [<ffffffff815fd6a3>] store_online+0x63/0xc0 [<ffffffff813c7078>] dev_attr_store+0x18/0x30 [<ffffffff811f02cf>] sysfs_write_file+0xef/0x170 [<ffffffff81180443>] vfs_write+0xb3/0x180 [<ffffffff8118076a>] sys_write+0x4a/0x90 [<ffffffff816236a9>] system_call_fastpath+0x16/0x1b Code: 48 c7 c7 94 60 01 a0 44 0f b7 ac 10 ac 00 00 00 31 c0 e8 41 b7 5f e1 41 83 c5 02 49 63 c5 49 8b 44 c4 10 48 85 c0 74 56 45 31 ff <39> 58 18 75 4e eb 1f 49 63 d7 4c 89 f7 48 89 45 c8 48 6b d2 28 RIP [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp] RSP <ffff880472fb3d48> CR2: 000000000000013c Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (fam15h_power) Fix pci_device_id arrayGuenter Roeck2012-04-26
| | | | | | | | | | | | | | | | | | | | | | pci_match_id() takes an *array* of IDs which must be properly zero- terminated. Reported-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@vger.kernel.org # 3.0+: 00250ec hwmon: fam15h_power: fix bogus values Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (ad7314) Fix build warningGuenter Roeck2012-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following build warning is seen in some configurations. drivers/hwmon/ad7314.c: In function 'ad7314_show_temperature': drivers/hwmon/ad7314.c:70: warning: 'data' may be used uninitialized in this function Fix by overloading the return value from ad7314_spi_read with both data and error code (the returned data is really u16 and needs to be converted into a signed value anyway). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (ads1015) Fix build warningGuenter Roeck2012-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following build warning is seen in some configurations. drivers/hwmon/ads1015.c: In function 'show_in': drivers/hwmon/ads1015.c:129: warning: 'in' may be used uninitialized in this function Fix by separating the register read function from the code converting the result into mV. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Dirk Eibach <eibach@gdsys.de> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | hwmon: fam15h_power: fix bogus values with current BIOSesAndre Przywara2012-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer BKDG[1] versions recommend a different initialization value for the running average range register in the northbridge. This improves the power reading by avoiding counter saturations resulting in bogus values for anything below about 80% of TDP power consumption. Updated BIOSes will have this new value set up from the beginning, but meanwhile we correct this value ourselves. This needs to be done on all northbridges, even on those where the driver itself does not register at. This fixes the driver on all current machines to provide proper values for idle load. [1] http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452) Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Jean Delvare <khali@linux-fr.org> [guenter.roeck@ericsson.com: Removed unnecessary return statement] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@vger.kernel.org # 3.0+
* | hwmon: (pmbus_core) Fix compiler warningGuenter Roeck2012-04-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some configurations produce the following compiler warning: drivers/hwmon/pmbus/pmbus_core.c: In function 'pmbus_show_boolean': drivers/hwmon/pmbus/pmbus_core.c:752: warning: 'val' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from pmbus_get_boolean with both val and error return code (val is a boolean and thus never negative). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | hwmon: (smsc47m1) Fix compiler warningGuenter Roeck2012-04-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some configurations produce the following compiler warning: drivers/hwmon/smsc47m1.c: In function 'sm_smsc47m1_init': drivers/hwmon/smsc47m1.c:938: warning: 'address' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from smsc47m1_find with both address and error return code (the address is an unsigned short and thus never negative). This also reduces module size by a few bytes (46 bytes for x86_64). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | hwmon: (acpi_power_meter) Fix compiler warning seen in some configurationsGuenter Roeck2012-04-09
| | | | | | | | | | | | | | | | | | | | | | | | | | In some configurations, BUG() does not result in an endless loop but returns to the caller. This results in the following compiler warning: drivers/hwmon/acpi_power_meter.c: In function 'show_str': drivers/hwmon/acpi_power_meter.c:380: warning: 'val' may be used uninitialized in this function Fix the warning by setting val to an empty string after BUG(). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | hwmon: (smsc47b397) Fix compiler warningGuenter Roeck2012-04-09
|/ | | | | | | | | | | | | | | | | Some configurations produce the following compiler warning: drivers/hwmon/smsc47b397.c: In function 'smsc47b397_init': drivers/hwmon/smsc47b397.c:385: warning: 'address' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from smsc47b397_find with both address and error return code (the address is an unsigned short and thus never negative). This also reduces module size by a few bytes (64 bytes for x86_64). Cc: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (ad7314) Adds missing spi_dev initializationGraeme Smecher2012-04-03
| | | | | | | | | | | This driver was recently moved from IIO (where it worked) to hwmon (where it doesn't.) This breakage occured because the hwmon version neglected to correctly initialize a reference to spi_dev in its drvdata. The result is a segfault every time the temperature is queried. Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com> Cc: stable@vger.kernel.org # 3.2+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (k10temp) Add support for AMD Trinity CPUsAndre Przywara2012-04-01
| | | | | | | | | | | | The on-chip northbridge's temperature sensor of the upcoming AMD Trinity CPUs works the same as for the previous CPUs. Since it has a different PCI-ID, we just add the new one to the list supported by k10temp. This allows to use the k10temp driver on those CPUs. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (w83627ehf) mark const init data with __initconst instead of __initdataUwe Kleine-König2012-04-01
| | | | | | | | | | | | | | | | | As long as there is no other non-const variable marked __initdata in the same compilation unit it doesn't hurt. If there were one however compilation would fail with error: $variablename causes a section type conflict because a section containing const variables is marked read only and so cannot contain non-const variables. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: lm-sensors@lm-sensors.org Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (acpi_power_meter) fix lockdep spew due to non-static lock classKyle McMartin2012-04-01
| | | | | | | | | | | | | | | | | | Similar to a30dcb4f which fixed asus_atk0110.ko, I recently received a bug report from someone hitting the same issue in acpi_power_meter. [ 13.963168] power_meter ACPI000D:00: Found ACPI power meter. [ 13.963900] BUG: key ffff8802161f3920 not in .data! [ 13.963904] ------------[ cut here ]------------ [ 13.963915] WARNING: at kernel/lockdep.c:2986 lockdep_init_map+0x52f/0x560() So let's fix that up for them by statically declaring the lockdep_class_key. Signed-off-by: Kyle McMartin <kyle@redhat.com> Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>