diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-21 16:40:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-21 16:40:40 -0400 |
commit | 7b8377862bd816a5e8ceb5c713d88bf82555c8d4 (patch) | |
tree | a22e9d373ec5d85343094320acbdcbe238b534da /drivers/hwmon | |
parent | 7940b2adb474608318e51294d4e9fa0eee1bef61 (diff) | |
parent | 2355375efdf10f43680d420023baa97796bfcdff (diff) |
Merge tag 'hwmon-for-linus' of 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
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/applesmc.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/emc2103.c | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index f082e48ab113..70d62f5bc909 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -215,7 +215,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
215 | int i; | 215 | int i; |
216 | 216 | ||
217 | if (send_command(cmd) || send_argument(key)) { | 217 | if (send_command(cmd) || send_argument(key)) { |
218 | pr_warn("%s: read arg fail\n", key); | 218 | pr_warn("%.4s: read arg fail\n", key); |
219 | return -EIO; | 219 | return -EIO; |
220 | } | 220 | } |
221 | 221 | ||
@@ -223,7 +223,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
223 | 223 | ||
224 | for (i = 0; i < len; i++) { | 224 | for (i = 0; i < len; i++) { |
225 | if (__wait_status(0x05)) { | 225 | if (__wait_status(0x05)) { |
226 | pr_warn("%s: read data fail\n", key); | 226 | pr_warn("%.4s: read data fail\n", key); |
227 | return -EIO; | 227 | return -EIO; |
228 | } | 228 | } |
229 | buffer[i] = inb(APPLESMC_DATA_PORT); | 229 | buffer[i] = inb(APPLESMC_DATA_PORT); |
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c index 9691f664c76e..e7d234b59312 100644 --- a/drivers/hwmon/emc2103.c +++ b/drivers/hwmon/emc2103.c | |||
@@ -451,11 +451,15 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
451 | data->fan_rpm_control = true; | 451 | data->fan_rpm_control = true; |
452 | break; | 452 | break; |
453 | default: | 453 | default: |
454 | mutex_unlock(&data->update_lock); | 454 | count = -EINVAL; |
455 | return -EINVAL; | 455 | goto err; |
456 | } | 456 | } |
457 | 457 | ||
458 | read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); | 458 | result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); |
459 | if (result) { | ||
460 | count = result; | ||
461 | goto err; | ||
462 | } | ||
459 | 463 | ||
460 | if (data->fan_rpm_control) | 464 | if (data->fan_rpm_control) |
461 | conf_reg |= 0x80; | 465 | conf_reg |= 0x80; |
@@ -463,7 +467,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
463 | conf_reg &= ~0x80; | 467 | conf_reg &= ~0x80; |
464 | 468 | ||
465 | i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); | 469 | i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); |
466 | 470 | err: | |
467 | mutex_unlock(&data->update_lock); | 471 | mutex_unlock(&data->update_lock); |
468 | return count; | 472 | return count; |
469 | } | 473 | } |