summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)Author
2013-10-18hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Simplify code and reduce its size. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (pmbus/ltc2978): Add support for LTC2978AGuenter Roeck
Detect LTC2978A chip ID. Treat it as LC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (pmbus/ltc2978): Add support for LTC2977Guenter Roeck
LTC2977 is a pin compatible replacement for LTC2978. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (pmbus/lm25066) Add support for LM25063Guenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: Correct some typosLABBE Corentin
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (gpio-fan) Include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (lm70) Remove redundant spi_set_drvdataSachin Kamat
Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Kaiwan N Billimoria <kaiwan@designergraphix.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (adcxx) Remove redundant spi_set_drvdataSachin Kamat
Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Marc Pignat <marc.pignat@hevs.ch> Acked-by: Marc Pignat <marc.pignat@hevs.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (jc42) fix coccinelle warningsFengguang Wu
drivers/hwmon/jc42.c:521:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (ltc4261) fix coccinelle warningsFengguang Wu
drivers/hwmon/ltc4261.c:243:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (lm95234) fix coccinelle warningsFengguang Wu
drivers/hwmon/lm95234.c:704:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (max6697) fix coccinelle warningsFengguang Wu
drivers/hwmon/max6697.c:649:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (max6642 fix coccinelle warningsFengguang Wu
drivers/hwmon/max6642.c:299:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (ds1621) fix coccinelle warningsFengguang Wu
drivers/hwmon/ds1621.c:381:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (nct6775) fix coccinelle warningsFengguang Wu
drivers/hwmon/nct6775.c:3866:1-3: WARNING: PTR_RET can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci CC: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (jc42) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (ltc4261) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (ina209) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (lm95234) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18hwmon: (tmp401) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (ina2xx) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also introduce dev variable in probe function to simplify access to client->dev, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (max16065) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Modify code to use is_visible to determine if an attribute should be created or not, then use devm_hwmon_device_register_with_groups to create the hwmon device and all attributes in one operation. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (max6697) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (lm73) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also introduce new variable dev pointing to client->dev in the probe function, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (max6642) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also rename new_client variable to client and introduce new variable dev pointing to client->dev in the probe function, and use new macro ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (ds1621) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Also use new macro __ATTRIBUTE_GROUPS to declare attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: Provide managed hwmon registrationGuenter Roeck
Drivers using the new hwmon_device_register_with_groups API often have a remove function which consists solely of a call hwmon_device_unregister(). Provide support for devm_hwmon_device_register_with_groups and devm_hwmon_device_unregister to allow this repeated code to be removed and help eliminate error handling code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (nct6775) Convert to use hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (pmbus) Convert to use hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (ltc4245) Convert to use hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (gpio-fan) Convert to use hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (ds1621) Convert to use hwmon_device_register_with_groupsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: Introduce hwmon_device_register_with_groupsGuenter Roeck
hwmon_device_register_with_groups() lets callers register a hwmon device together with all sysfs attributes in a single call. When using hwmon_device_register_with_groups(), hwmon attributes are attached to the hwmon device directly and no longer with its parent device. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (f71882fg) Remove extra return statementGuenter Roeck
Leftover from commit 33cd66e3 (hwmon: (f71882fg) Convert to use devm_ functions). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (f75375s) Don't crash the kernel unnecessarilyGuenter Roeck
The f75375s driver crashes the kernel if it detects an an internal implementation error. While the detected conditions suggest that there is a bug in the code, the condition is not fatal. Replace BUG() with WARN(). Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (atxp1) Set and use error code from vid_to_reg()Guenter Roeck
vid_to_reg() returns -1 if it encounters an error. Return -EINVAL instead. Its only caller, atxp1_storevcore(), doesn't use the return code but returns -1 instead, which is wrong anyway as it means -EPERM. Use the return value from vid_to_reg() instead to report the error. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
2013-10-13hwmon: (acpi_power_meter) Use return value from acpi_bus_register_driverGuenter Roeck
acpi_bus_register_driver() returns a valid error code. Use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (acpi_power_meter) Don't crash the kernel unnecessarilyGuenter Roeck
acpi_power_meter crashes the kernel if it detects an unexpected event or an internal implementation error. While the detected conditions suggest that there is a bug in the code, the condition is not fatal. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (gpio_fan) Use error value returned from get_fan_speed_index()Guenter Roeck
get_fan_speed_index() returns -EINVAL in case of errors, only to have it ignored and replaced with -ENODEV. Make it return -ENODEV and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (adt7462) Use error value returned from find_trange_value()Guenter Roeck
find_trange_value() returns -ENODEV in case of errors, only to have it ignored and replaced with -EINVAL. Make it return -EINVAL and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
2013-10-13hwmon: (pmbus) Don't unnecessarily crash the kernelGuenter Roeck
pmbus code currently crashes the kernel if it detects an internal implementation error. While the detected condition suggests that there is a bug in the code, it is hardly fatal. Therefore, it should not trigger a crash. Replace BUG() with WARN(). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (mc13783-adc) Increase size of name stringGuenter Roeck
smatch complains about mc13783_adc_probe() error: snprintf() chops off the last chars of 'id->name': 20 +vs 10 Use PLATFORM_NAME_SIZE instead of '10' as size when declaring the name variable. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (nct6775) Check array index when accessing temp_offsetGuenter Roeck
smatch complains about a potential out-of-bounds access to the temp_offset array. That doesn't happen in practice, but it doesn't hurt to add an explicit check either. This prevents potential problems in the future (for example if the number of 'fixed' temperature sensors is increased to add support for another chip). Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: (nct6775) Use return value from find_temp_sourceGuenter Roeck
smatch complains that we don't use the return value from find_temp_source(). Valid point, only find_temp_source() doesn't return a valid error code. Have it return a valid error code and use it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13hwmon: Remove unnecessary semicolonsGuenter Roeck
Semicolons after closing } of conditional blocks are not needed and can be removed. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>
2013-10-09hwmon: (applesmc) Always read until end of dataHenrik Rydberg
The crash reported and investigated in commit 5f4513 turned out to be caused by a change to the read interface on newer (2012) SMCs. Tests by Chris show that simply reading the data valid line is enough for the problem to go away. Additional tests show that the newer SMCs no longer wait for the number of requested bytes, but start sending data right away. Apparently the number of bytes to read is no longer specified as before, but instead found out by reading until end of data. Failure to read until end of data confuses the state machine, which eventually causes the crash. As a remedy, assuming bit0 is the read valid line, make sure there is nothing more to read before leaving the read function. Tested to resolve the original problem, and runtested on MBA3,1, MBP4,1, MBP8,2, MBP10,1, MBP10,2. The patch seems to have no effect on machines before 2012. Tested-by: Chris Murphy <chris@cmurf.com> Cc: stable@vger.kernel.org Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-03hwmon: (adt7310) Use spi_w8r16be() instead spi_w8r16()Lars-Peter Clausen
Using spi_w8r16be() instead of spi_w8r16() in this driver makes a code a bit shorter and cleaner. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-26hwmon: (applesmc) Check key count before proceedingHenrik Rydberg
After reports from Chris and Josh Boyer of a rare crash in applesmc, Guenter pointed at the initialization problem fixed below. The patch has not been verified to fix the crash, but should be applied regardless. Reported-by: <jwboyer@fedoraproject.org> Suggested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-09-12hwmon: (k10temp) remove unnecessary pci_set_drvdata()Jingoo Han
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>