1
0
Fork 0
Commit Graph

400698 Commits (1e687e806b8ea1b1428e3e664afd4081e435f6d0)

Author SHA1 Message Date
Dan Carpenter 1e687e806b hwmon: (nct6775) Remove an unused variable
We don't actually use "j" for anything.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-19 09:04:24 -07:00
Guenter Roeck 0011ddfe6a hwmon: (emc1403) Add support for EMC1404 and EMC1424
EMC1404 and EMC1424 are similar to EMC1403 and EMC1423,
but support an additional external temperature sensor.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:12:04 -07:00
Guenter Roeck 454aee17fd hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups
Simplify code and reduce its size.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:12:03 -07:00
Guenter Roeck 3f08d7f49f hwmon: (pmbus/ltc2978): Add support for LTC2978A
Detect LTC2978A chip ID. Treat it as LC2978.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:12:03 -07:00
Guenter Roeck c24c407e96 hwmon: (pmbus/ltc2978): Add support for LTC2977
LTC2977 is a pin compatible replacement for LTC2978.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:12:03 -07:00
Guenter Roeck c8ccab7ab5 hwmon: (pmbus/lm25066) Add support for LM25063
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:12:02 -07:00
LABBE Corentin 84fb029faa hwmon: Correct some typos
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:12:02 -07:00
Sachin Kamat c50588abab hwmon: (gpio-fan) Include linux/of.h header
'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-18 09:12:02 -07:00
Sachin Kamat 2825f033da hwmon: (lm70) Remove redundant spi_set_drvdata
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-18 09:12:01 -07:00
Sachin Kamat 20652ab8ca hwmon: (adcxx) Remove redundant spi_set_drvdata
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-18 09:12:01 -07:00
Fengguang Wu 650a2c02b5 hwmon: (jc42) fix coccinelle warnings
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-18 09:12:01 -07:00
Fengguang Wu 2a253c4789 hwmon: (ltc4261) fix coccinelle warnings
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-18 09:12:00 -07:00
Fengguang Wu 3ea85ba7af hwmon: (lm95234) fix coccinelle warnings
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-18 09:12:00 -07:00
Fengguang Wu 4109a71608 hwmon: (max6697) fix coccinelle warnings
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-18 09:11:59 -07:00
Fengguang Wu e5840c78f3 hwmon: (max6642 fix coccinelle warnings
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-18 09:11:59 -07:00
Fengguang Wu 31ab1ad70b hwmon: (ds1621) fix coccinelle warnings
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-18 09:11:59 -07:00
Fengguang Wu 9c09bd8d89 hwmon: (nct6775) fix coccinelle warnings
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-18 09:11:58 -07:00
Guenter Roeck 62f9a57c0b hwmon: (jc42) Convert to use devm_hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:11:58 -07:00
Guenter Roeck 38f150fe38 hwmon: (ltc4261) Convert to use devm_hwmon_device_register_with_groups
Also use new macro ATTRIBUTE_GROUPS to declare attribute groups.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:11:58 -07:00
Guenter Roeck 89de734471 hwmon: (ina209) Convert to use devm_hwmon_device_register_with_groups
Also use new macro ATTRIBUTE_GROUPS to declare attribute groups.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:11:57 -07:00
Guenter Roeck 9d86bd6ba3 hwmon: (lm95234) Convert to use devm_hwmon_device_register_with_groups
Also use new macro ATTRIBUTE_GROUPS to declare attribute groups.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:11:57 -07:00
Guenter Roeck f3643ac7ff hwmon: (tmp401) Convert to use devm_hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-18 09:11:52 -07:00
Guenter Roeck 468bf0e395 hwmon: (ina2xx) Convert to use devm_hwmon_device_register_with_groups
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-13 16:16:29 -07:00
Guenter Roeck 38c75dc36d hwmon: (max16065) Convert to use devm_hwmon_device_register_with_groups
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-13 16:16:29 -07:00
Guenter Roeck 8d3735522f hwmon: (max6697) Convert to use devm_hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:28 -07:00
Guenter Roeck 3710263f13 hwmon: (lm73) Convert to use devm_hwmon_device_register_with_groups
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-13 16:16:28 -07:00
Guenter Roeck 9bd024e9fd hwmon: (max6642) Convert to use devm_hwmon_device_register_with_groups
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-13 16:16:28 -07:00
Guenter Roeck 0d36dce0f1 hwmon: (ds1621) Convert to use devm_hwmon_device_register_with_groups
Also use new macro __ATTRIBUTE_GROUPS to declare attribute groups.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:28 -07:00
Guenter Roeck a150d95b7c hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:28 -07:00
Guenter Roeck 74188cba08 hwmon: Provide managed hwmon registration
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-13 16:16:28 -07:00
Guenter Roeck 615fc8cb0f hwmon: (nct6775) Convert to use hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:28 -07:00
Guenter Roeck c3b7cddc70 hwmon: (pmbus) Convert to use hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:27 -07:00
Guenter Roeck 9a85d53cfc hwmon: (ltc4245) Convert to use hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:27 -07:00
Guenter Roeck 7258a12536 hwmon: (gpio-fan) Convert to use hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:27 -07:00
Guenter Roeck 8269b75ae7 hwmon: (ds1621) Convert to use hwmon_device_register_with_groups
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:27 -07:00
Guenter Roeck bab2243ce1 hwmon: Introduce hwmon_device_register_with_groups
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-13 16:16:27 -07:00
Guenter Roeck 522928a87f hwmon: (f71882fg) Remove extra return statement
Leftover from commit 33cd66e3 (hwmon: (f71882fg) Convert to use
devm_ functions).

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:27 -07:00
Guenter Roeck 39b103b4d2 hwmon: (f75375s) Don't crash the kernel unnecessarily
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-13 16:16:27 -07:00
Guenter Roeck 674d0ed858 hwmon: (atxp1) Set and use error code from vid_to_reg()
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-13 16:16:26 -07:00
Guenter Roeck 19f053c840 hwmon: (acpi_power_meter) Use return value from acpi_bus_register_driver
acpi_bus_register_driver() returns a valid error code. Use it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-10-13 16:16:26 -07:00
Guenter Roeck 83c97fe13e hwmon: (acpi_power_meter) Don't crash the kernel unnecessarily
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-13 16:16:26 -07:00
Guenter Roeck c52ae3d279 hwmon: (gpio_fan) Use error value returned from get_fan_speed_index()
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-13 16:16:26 -07:00
Guenter Roeck bb34c0da64 hwmon: (adt7462) Use error value returned from find_trange_value()
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-13 16:16:26 -07:00
Guenter Roeck af78fdf4a6 hwmon: (pmbus) Don't unnecessarily crash the kernel
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-13 16:16:26 -07:00
Guenter Roeck ae02e7418f hwmon: (mc13783-adc) Increase size of name string
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-13 16:16:26 -07:00
Guenter Roeck 45a5b3a183 hwmon: (nct6775) Check array index when accessing temp_offset
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-13 16:16:25 -07:00
Guenter Roeck e8ab508c27 hwmon: (nct6775) Use return value from find_temp_source
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-13 16:16:25 -07:00
Guenter Roeck a039371353 hwmon: Remove unnecessary semicolons
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-13 16:16:25 -07:00
Linus Torvalds 61e6cfa80d Linux 3.12-rc5 2013-10-13 15:41:28 -07:00
Linus Torvalds 73cac03d0c Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog fixes from Wim Van Sebroeck:
 "This will fix a deadlock on the ts72xx_wdt driver, fix bitmasks in the
  kempld_wdt driver and fix a section mismatch in the sunxi_wdt driver"

* git://www.linux-watchdog.org/linux-watchdog:
  watchdog: sunxi: Fix section mismatch
  watchdog: kempld_wdt: Fix bit mask definition
  watchdog: ts72xx_wdt: locking bug in ioctl
2013-10-13 11:41:26 -07:00