Skip to content

Commit 0a2fbed

Browse files
committed
Merge tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: "Minor fixes/regressions" * tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table hwmon: (occ) Fix potential integer overflow hwmon: (lm80) Fix missing unlock on error in set_fan_div() hwmon: (nct6775) Enable IO mapping for NCT6797D and NCT6798D hwmon: (nct6775) Fix chip ID for NCT6798D
2 parents a3a8025 + f422449 commit 0a2fbed

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

drivers/hwmon/lm80.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
393393
}
394394

395395
rv = lm80_read_value(client, LM80_REG_FANDIV);
396-
if (rv < 0)
396+
if (rv < 0) {
397+
mutex_unlock(&data->update_lock);
397398
return rv;
399+
}
398400
reg = (rv & ~(3 << (2 * (nr + 1))))
399401
| (data->fan_div[nr] << (2 * (nr + 1)));
400402
lm80_write_value(client, LM80_REG_FANDIV, reg);

drivers/hwmon/nct6775.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
* nct6796d 14 7 7 2+6 0xd420 0xc1 0x5ca3
4545
* nct6797d 14 7 7 2+6 0xd450 0xc1 0x5ca3
4646
* (0xd451)
47-
* nct6798d 14 7 7 2+6 0xd458 0xc1 0x5ca3
48-
* (0xd459)
47+
* nct6798d 14 7 7 2+6 0xd428 0xc1 0x5ca3
48+
* (0xd429)
4949
*
5050
* #temp lists the number of monitored temperature sources (first value) plus
5151
* the number of directly connectable temperature sensors (second value).
@@ -138,7 +138,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
138138
#define SIO_NCT6795_ID 0xd350
139139
#define SIO_NCT6796_ID 0xd420
140140
#define SIO_NCT6797_ID 0xd450
141-
#define SIO_NCT6798_ID 0xd458
141+
#define SIO_NCT6798_ID 0xd428
142142
#define SIO_ID_MASK 0xFFF8
143143

144144
enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 };
@@ -4508,7 +4508,8 @@ static int __maybe_unused nct6775_resume(struct device *dev)
45084508

45094509
if (data->kind == nct6791 || data->kind == nct6792 ||
45104510
data->kind == nct6793 || data->kind == nct6795 ||
4511-
data->kind == nct6796)
4511+
data->kind == nct6796 || data->kind == nct6797 ||
4512+
data->kind == nct6798)
45124513
nct6791_enable_io_mapping(sioreg);
45134514

45144515
superio_exit(sioreg);
@@ -4644,7 +4645,8 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
46444645

46454646
if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
46464647
sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
4647-
sio_data->kind == nct6796)
4648+
sio_data->kind == nct6796 || sio_data->kind == nct6797 ||
4649+
sio_data->kind == nct6798)
46484650
nct6791_enable_io_mapping(sioaddr);
46494651

46504652
superio_exit(sioaddr);

drivers/hwmon/occ/common.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ static ssize_t occ_show_power_1(struct device *dev,
380380
val *= 1000000ULL;
381381
break;
382382
case 2:
383-
val = get_unaligned_be32(&power->update_tag) *
384-
occ->powr_sample_time_us;
383+
val = (u64)get_unaligned_be32(&power->update_tag) *
384+
occ->powr_sample_time_us;
385385
break;
386386
case 3:
387387
val = get_unaligned_be16(&power->value) * 1000000ULL;
@@ -425,8 +425,8 @@ static ssize_t occ_show_power_2(struct device *dev,
425425
&power->update_tag);
426426
break;
427427
case 2:
428-
val = get_unaligned_be32(&power->update_tag) *
429-
occ->powr_sample_time_us;
428+
val = (u64)get_unaligned_be32(&power->update_tag) *
429+
occ->powr_sample_time_us;
430430
break;
431431
case 3:
432432
val = get_unaligned_be16(&power->value) * 1000000ULL;
@@ -463,8 +463,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
463463
&power->system.update_tag);
464464
break;
465465
case 2:
466-
val = get_unaligned_be32(&power->system.update_tag) *
467-
occ->powr_sample_time_us;
466+
val = (u64)get_unaligned_be32(&power->system.update_tag) *
467+
occ->powr_sample_time_us;
468468
break;
469469
case 3:
470470
val = get_unaligned_be16(&power->system.value) * 1000000ULL;
@@ -477,8 +477,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
477477
&power->proc.update_tag);
478478
break;
479479
case 6:
480-
val = get_unaligned_be32(&power->proc.update_tag) *
481-
occ->powr_sample_time_us;
480+
val = (u64)get_unaligned_be32(&power->proc.update_tag) *
481+
occ->powr_sample_time_us;
482482
break;
483483
case 7:
484484
val = get_unaligned_be16(&power->proc.value) * 1000000ULL;
@@ -491,8 +491,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
491491
&power->vdd.update_tag);
492492
break;
493493
case 10:
494-
val = get_unaligned_be32(&power->vdd.update_tag) *
495-
occ->powr_sample_time_us;
494+
val = (u64)get_unaligned_be32(&power->vdd.update_tag) *
495+
occ->powr_sample_time_us;
496496
break;
497497
case 11:
498498
val = get_unaligned_be16(&power->vdd.value) * 1000000ULL;
@@ -505,8 +505,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
505505
&power->vdn.update_tag);
506506
break;
507507
case 14:
508-
val = get_unaligned_be32(&power->vdn.update_tag) *
509-
occ->powr_sample_time_us;
508+
val = (u64)get_unaligned_be32(&power->vdn.update_tag) *
509+
occ->powr_sample_time_us;
510510
break;
511511
case 15:
512512
val = get_unaligned_be16(&power->vdn.value) * 1000000ULL;

drivers/hwmon/tmp421.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = {
8888
.data = (void *)2
8989
},
9090
{
91-
.compatible = "ti,tmp422",
91+
.compatible = "ti,tmp442",
9292
.data = (void *)3
9393
},
9494
{ },

0 commit comments

Comments
 (0)