diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 16:29:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 16:29:18 -0400 |
commit | 0cd5ff591ab6473355d5a6a47f7694def28e451d (patch) | |
tree | aed0ea4fbb724f13208ed76d438518ffc9130a17 /drivers/hwmon/acpi_power_meter.c | |
parent | 3539fc544f39017cf3403b9319fb4d74b5116135 (diff) | |
parent | e30bca12573fbf54e2470723aadc047549d147ce (diff) |
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck:
"New drivers for DA9052/53 PMIC as well as HIH-6130/HIH-6131 humidity
and temperature sensors.
Convert drivers to use devm_ functions and to use dev_pm_ops. Address
a couple of Coverity errors/warnings as well as compile warnings.
Some functional improvements in applesmc driver."
* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (72 commits)
hwmon: (applesmc) Ignore some temperature registers
hwmon: (applesmc) Allow negative temperature values
hwmon: (s3c-hwmon) Use devm_kzalloc instead of kzalloc
hwmon: (w83781d) Fix compile warning
hwmon: (applesmc) Shorten minimum wait time
hwmon: (exynos4_tmu) Use struct dev_pm_ops for power management
hwmon: (gpio-fan) Use struct dev_pm_ops for power management
hwmon: (abituguru3) Use struct dev_pm_ops for power management
hwmon: (abituguru) Use struct dev_pm_ops for power management
hwmon: (acpi_power_meter) Fix unintentional integer overflow
hwmon: (acpi_power_meter) Cleanup and optimizations
hwmon: Honeywell Humidicon HIH-6130/HIH-6131 humidity and temperature sensor driver
hwmon: (applesmc) Skip sensor mapping
hwmon: (ntc_thermistor) Ensure that data->name string is terminated
hwmon: (w83l785ts) Convert to use devm_ functions
hwmon: (w83l785ts) Simplify code and improve readability
hwmon: (smsc47m192) Convert to use devm_ functions
hwmon: (smsc47m1) Convert to use devm_ functions
hwmon: (smsc47b397) Convert to use devm_ functions
hwmon: (k8temp) Convert to use devm_ functions
...
Diffstat (limited to 'drivers/hwmon/acpi_power_meter.c')
-rw-r--r-- | drivers/hwmon/acpi_power_meter.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index e3fcf8146834..563c02904ddf 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c | |||
@@ -101,7 +101,7 @@ struct acpi_power_meter_resource { | |||
101 | unsigned long sensors_last_updated; | 101 | unsigned long sensors_last_updated; |
102 | struct sensor_device_attribute sensors[NUM_SENSORS]; | 102 | struct sensor_device_attribute sensors[NUM_SENSORS]; |
103 | int num_sensors; | 103 | int num_sensors; |
104 | int trip[2]; | 104 | s64 trip[2]; |
105 | int num_domain_devices; | 105 | int num_domain_devices; |
106 | struct acpi_device **domain_devices; | 106 | struct acpi_device **domain_devices; |
107 | struct kobject *holders_dir; | 107 | struct kobject *holders_dir; |
@@ -237,7 +237,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr, | |||
237 | if (res) | 237 | if (res) |
238 | return res; | 238 | return res; |
239 | 239 | ||
240 | temp /= 1000; | 240 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
241 | if (temp > resource->caps.max_cap || temp < resource->caps.min_cap) | 241 | if (temp > resource->caps.max_cap || temp < resource->caps.min_cap) |
242 | return -EINVAL; | 242 | return -EINVAL; |
243 | arg0.integer.value = temp; | 243 | arg0.integer.value = temp; |
@@ -307,9 +307,7 @@ static ssize_t set_trip(struct device *dev, struct device_attribute *devattr, | |||
307 | if (res) | 307 | if (res) |
308 | return res; | 308 | return res; |
309 | 309 | ||
310 | temp /= 1000; | 310 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
311 | if (temp < 0) | ||
312 | return -EINVAL; | ||
313 | 311 | ||
314 | mutex_lock(&resource->lock); | 312 | mutex_lock(&resource->lock); |
315 | resource->trip[attr->index - 7] = temp; | 313 | resource->trip[attr->index - 7] = temp; |