Skip to content

Commit bdbdfde

Browse files
committed
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
2 parents 6700215 + 0b77f76 commit bdbdfde

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

drivers/hwmon/amc6821.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static ssize_t set_pwm1_enable(
364364
if (config < 0) {
365365
dev_err(&client->dev,
366366
"Error reading configuration register, aborting.\n");
367-
return -EIO;
367+
return config;
368368
}
369369

370370
switch (val) {
@@ -416,11 +416,9 @@ static ssize_t get_temp_auto_point_temp(
416416
case 1:
417417
return sprintf(buf, "%d\n",
418418
data->temp1_auto_point_temp[ix] * 1000);
419-
break;
420419
case 2:
421420
return sprintf(buf, "%d\n",
422421
data->temp2_auto_point_temp[ix] * 1000);
423-
break;
424422
default:
425423
dev_dbg(dev, "Unknown attr->nr (%d).\n", nr);
426424
return -EINVAL;
@@ -513,7 +511,6 @@ static ssize_t set_temp_auto_point_temp(
513511
count = -EIO;
514512
}
515513
goto EXIT;
516-
break;
517514
case 1:
518515
ptemp[1] = clamp_val(val / 1000, (ptemp[0] & 0x7C) + 4, 124);
519516
ptemp[1] &= 0x7C;
@@ -665,7 +662,7 @@ static ssize_t set_fan1_div(
665662
if (config < 0) {
666663
dev_err(&client->dev,
667664
"Error reading configuration register, aborting.\n");
668-
return -EIO;
665+
return config;
669666
}
670667
mutex_lock(&data->update_lock);
671668
switch (val) {

drivers/hwmon/emc2103.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da,
248248

249249
int result = kstrtol(buf, 10, &val);
250250
if (result < 0)
251-
return -EINVAL;
251+
return result;
252252

253253
val = DIV_ROUND_CLOSEST(val, 1000);
254254
if ((val < -63) || (val > 127))
@@ -272,7 +272,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da,
272272

273273
int result = kstrtol(buf, 10, &val);
274274
if (result < 0)
275-
return -EINVAL;
275+
return result;
276276

277277
val = DIV_ROUND_CLOSEST(val, 1000);
278278
if ((val < -63) || (val > 127))
@@ -320,7 +320,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da,
320320

321321
int status = kstrtol(buf, 10, &new_div);
322322
if (status < 0)
323-
return -EINVAL;
323+
return status;
324324

325325
if (new_div == old_div) /* No change */
326326
return count;
@@ -394,7 +394,7 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da,
394394

395395
int result = kstrtol(buf, 10, &rpm_target);
396396
if (result < 0)
397-
return -EINVAL;
397+
return result;
398398

399399
/* Datasheet states 16384 as maximum RPM target (table 3.2) */
400400
if ((rpm_target < 0) || (rpm_target > 16384))
@@ -440,7 +440,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da,
440440

441441
int result = kstrtol(buf, 10, &new_value);
442442
if (result < 0)
443-
return -EINVAL;
443+
return result;
444444

445445
mutex_lock(&data->update_lock);
446446
switch (new_value) {

drivers/hwmon/ibmaem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static int aem_init_ipmi_data(struct aem_ipmi_data *data, int iface,
292292
dev_err(bmc,
293293
"Unable to register user with IPMI interface %d\n",
294294
data->interface);
295-
return -EACCES;
295+
return err;
296296
}
297297

298298
return 0;

drivers/hwmon/k10temp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ static void k10temp_remove(struct pci_dev *pdev)
202202
&sensor_dev_attr_temp1_crit.dev_attr);
203203
device_remove_file(&pdev->dev,
204204
&sensor_dev_attr_temp1_crit_hyst.dev_attr);
205-
pci_set_drvdata(pdev, NULL);
206205
}
207206

208207
static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {

drivers/hwmon/tmp421.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int tmp421_init_client(struct i2c_client *client)
210210
if (config < 0) {
211211
dev_err(&client->dev,
212212
"Could not read configuration register (%d)\n", config);
213-
return -ENODEV;
213+
return config;
214214
}
215215

216216
config_orig = config;

0 commit comments

Comments
 (0)