diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-13 13:58:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-13 13:58:41 -0400 |
commit | bdbdfdef5766c2a60185e946df242f1bc0d37c09 (patch) | |
tree | 1dea71a3d6a176f481f14cf85c2c834a70435184 | |
parent | 67002151403350b497c1efc8d36450974dfca023 (diff) | |
parent | 0b77f766f3ef9875e2bb0035c9b89b4f9469b78d (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:
"Some more low risk cleanup patches:
- Remove unnecessary pci_set_drvdata in k10temp driver from Jingoo Han
- Fix return values in several drivers from Sachin Kamat
- Remove redundant break in amc6821 driver from Sachin Kamat"
* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (k10temp) remove unnecessary pci_set_drvdata()
hwmon: (tmp421) Fix return value
hwmon: (amc6821) Remove redundant break
hwmon: (amc6821) Fix return value
hwmon: (ibmaem) Fix return value
hwmon: (emc2103) Fix return value
-rw-r--r-- | drivers/hwmon/amc6821.c | 7 | ||||
-rw-r--r-- | drivers/hwmon/emc2103.c | 10 | ||||
-rw-r--r-- | drivers/hwmon/ibmaem.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/k10temp.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/tmp421.c | 2 |
5 files changed, 9 insertions, 13 deletions
diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index 4fe49d2bfe1d..eea817296513 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c | |||
@@ -364,7 +364,7 @@ static ssize_t set_pwm1_enable( | |||
364 | if (config < 0) { | 364 | if (config < 0) { |
365 | dev_err(&client->dev, | 365 | dev_err(&client->dev, |
366 | "Error reading configuration register, aborting.\n"); | 366 | "Error reading configuration register, aborting.\n"); |
367 | return -EIO; | 367 | return config; |
368 | } | 368 | } |
369 | 369 | ||
370 | switch (val) { | 370 | switch (val) { |
@@ -416,11 +416,9 @@ static ssize_t get_temp_auto_point_temp( | |||
416 | case 1: | 416 | case 1: |
417 | return sprintf(buf, "%d\n", | 417 | return sprintf(buf, "%d\n", |
418 | data->temp1_auto_point_temp[ix] * 1000); | 418 | data->temp1_auto_point_temp[ix] * 1000); |
419 | break; | ||
420 | case 2: | 419 | case 2: |
421 | return sprintf(buf, "%d\n", | 420 | return sprintf(buf, "%d\n", |
422 | data->temp2_auto_point_temp[ix] * 1000); | 421 | data->temp2_auto_point_temp[ix] * 1000); |
423 | break; | ||
424 | default: | 422 | default: |
425 | dev_dbg(dev, "Unknown attr->nr (%d).\n", nr); | 423 | dev_dbg(dev, "Unknown attr->nr (%d).\n", nr); |
426 | return -EINVAL; | 424 | return -EINVAL; |
@@ -513,7 +511,6 @@ static ssize_t set_temp_auto_point_temp( | |||
513 | count = -EIO; | 511 | count = -EIO; |
514 | } | 512 | } |
515 | goto EXIT; | 513 | goto EXIT; |
516 | break; | ||
517 | case 1: | 514 | case 1: |
518 | ptemp[1] = clamp_val(val / 1000, (ptemp[0] & 0x7C) + 4, 124); | 515 | ptemp[1] = clamp_val(val / 1000, (ptemp[0] & 0x7C) + 4, 124); |
519 | ptemp[1] &= 0x7C; | 516 | ptemp[1] &= 0x7C; |
@@ -665,7 +662,7 @@ static ssize_t set_fan1_div( | |||
665 | if (config < 0) { | 662 | if (config < 0) { |
666 | dev_err(&client->dev, | 663 | dev_err(&client->dev, |
667 | "Error reading configuration register, aborting.\n"); | 664 | "Error reading configuration register, aborting.\n"); |
668 | return -EIO; | 665 | return config; |
669 | } | 666 | } |
670 | mutex_lock(&data->update_lock); | 667 | mutex_lock(&data->update_lock); |
671 | switch (val) { | 668 | switch (val) { |
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c index b07305622087..2c137b26acb4 100644 --- a/drivers/hwmon/emc2103.c +++ b/drivers/hwmon/emc2103.c | |||
@@ -248,7 +248,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da, | |||
248 | 248 | ||
249 | int result = kstrtol(buf, 10, &val); | 249 | int result = kstrtol(buf, 10, &val); |
250 | if (result < 0) | 250 | if (result < 0) |
251 | return -EINVAL; | 251 | return result; |
252 | 252 | ||
253 | val = DIV_ROUND_CLOSEST(val, 1000); | 253 | val = DIV_ROUND_CLOSEST(val, 1000); |
254 | if ((val < -63) || (val > 127)) | 254 | if ((val < -63) || (val > 127)) |
@@ -272,7 +272,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da, | |||
272 | 272 | ||
273 | int result = kstrtol(buf, 10, &val); | 273 | int result = kstrtol(buf, 10, &val); |
274 | if (result < 0) | 274 | if (result < 0) |
275 | return -EINVAL; | 275 | return result; |
276 | 276 | ||
277 | val = DIV_ROUND_CLOSEST(val, 1000); | 277 | val = DIV_ROUND_CLOSEST(val, 1000); |
278 | if ((val < -63) || (val > 127)) | 278 | if ((val < -63) || (val > 127)) |
@@ -320,7 +320,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da, | |||
320 | 320 | ||
321 | int status = kstrtol(buf, 10, &new_div); | 321 | int status = kstrtol(buf, 10, &new_div); |
322 | if (status < 0) | 322 | if (status < 0) |
323 | return -EINVAL; | 323 | return status; |
324 | 324 | ||
325 | if (new_div == old_div) /* No change */ | 325 | if (new_div == old_div) /* No change */ |
326 | return count; | 326 | return count; |
@@ -394,7 +394,7 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da, | |||
394 | 394 | ||
395 | int result = kstrtol(buf, 10, &rpm_target); | 395 | int result = kstrtol(buf, 10, &rpm_target); |
396 | if (result < 0) | 396 | if (result < 0) |
397 | return -EINVAL; | 397 | return result; |
398 | 398 | ||
399 | /* Datasheet states 16384 as maximum RPM target (table 3.2) */ | 399 | /* Datasheet states 16384 as maximum RPM target (table 3.2) */ |
400 | if ((rpm_target < 0) || (rpm_target > 16384)) | 400 | if ((rpm_target < 0) || (rpm_target > 16384)) |
@@ -440,7 +440,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
440 | 440 | ||
441 | int result = kstrtol(buf, 10, &new_value); | 441 | int result = kstrtol(buf, 10, &new_value); |
442 | if (result < 0) | 442 | if (result < 0) |
443 | return -EINVAL; | 443 | return result; |
444 | 444 | ||
445 | mutex_lock(&data->update_lock); | 445 | mutex_lock(&data->update_lock); |
446 | switch (new_value) { | 446 | switch (new_value) { |
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index e2b56a2b756c..632f1dc0fe1f 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c | |||
@@ -292,7 +292,7 @@ static int aem_init_ipmi_data(struct aem_ipmi_data *data, int iface, | |||
292 | dev_err(bmc, | 292 | dev_err(bmc, |
293 | "Unable to register user with IPMI interface %d\n", | 293 | "Unable to register user with IPMI interface %d\n", |
294 | data->interface); | 294 | data->interface); |
295 | return -EACCES; | 295 | return err; |
296 | } | 296 | } |
297 | 297 | ||
298 | return 0; | 298 | return 0; |
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index e633856370cf..d65f3fd895dd 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c | |||
@@ -202,7 +202,6 @@ static void k10temp_remove(struct pci_dev *pdev) | |||
202 | &sensor_dev_attr_temp1_crit.dev_attr); | 202 | &sensor_dev_attr_temp1_crit.dev_attr); |
203 | device_remove_file(&pdev->dev, | 203 | device_remove_file(&pdev->dev, |
204 | &sensor_dev_attr_temp1_crit_hyst.dev_attr); | 204 | &sensor_dev_attr_temp1_crit_hyst.dev_attr); |
205 | pci_set_drvdata(pdev, NULL); | ||
206 | } | 205 | } |
207 | 206 | ||
208 | static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = { | 207 | static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = { |
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index 964c1d688274..ae26b06fa819 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c | |||
@@ -210,7 +210,7 @@ static int tmp421_init_client(struct i2c_client *client) | |||
210 | if (config < 0) { | 210 | if (config < 0) { |
211 | dev_err(&client->dev, | 211 | dev_err(&client->dev, |
212 | "Could not read configuration register (%d)\n", config); | 212 | "Could not read configuration register (%d)\n", config); |
213 | return -ENODEV; | 213 | return config; |
214 | } | 214 | } |
215 | 215 | ||
216 | config_orig = config; | 216 | config_orig = config; |