Skip to content

Commit

Permalink
Merge tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Jan 18, 2019
2 parents a3a8025 + f422449 commit 0a2fbed
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
4 changes: 3 additions & 1 deletion drivers/hwmon/lm80.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
}

rv = lm80_read_value(client, LM80_REG_FANDIV);
if (rv < 0)
if (rv < 0) {
mutex_unlock(&data->update_lock);
return rv;
}
reg = (rv & ~(3 << (2 * (nr + 1))))
| (data->fan_div[nr] << (2 * (nr + 1)));
lm80_write_value(client, LM80_REG_FANDIV, reg);
Expand Down
12 changes: 7 additions & 5 deletions drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
* nct6796d 14 7 7 2+6 0xd420 0xc1 0x5ca3
* nct6797d 14 7 7 2+6 0xd450 0xc1 0x5ca3
* (0xd451)
* nct6798d 14 7 7 2+6 0xd458 0xc1 0x5ca3
* (0xd459)
* nct6798d 14 7 7 2+6 0xd428 0xc1 0x5ca3
* (0xd429)
*
* #temp lists the number of monitored temperature sources (first value) plus
* the number of directly connectable temperature sensors (second value).
Expand Down Expand Up @@ -138,7 +138,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
#define SIO_NCT6795_ID 0xd350
#define SIO_NCT6796_ID 0xd420
#define SIO_NCT6797_ID 0xd450
#define SIO_NCT6798_ID 0xd458
#define SIO_NCT6798_ID 0xd428
#define SIO_ID_MASK 0xFFF8

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

if (data->kind == nct6791 || data->kind == nct6792 ||
data->kind == nct6793 || data->kind == nct6795 ||
data->kind == nct6796)
data->kind == nct6796 || data->kind == nct6797 ||
data->kind == nct6798)
nct6791_enable_io_mapping(sioreg);

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

if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
sio_data->kind == nct6796)
sio_data->kind == nct6796 || sio_data->kind == nct6797 ||
sio_data->kind == nct6798)
nct6791_enable_io_mapping(sioaddr);

superio_exit(sioaddr);
Expand Down
24 changes: 12 additions & 12 deletions drivers/hwmon/occ/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ static ssize_t occ_show_power_1(struct device *dev,
val *= 1000000ULL;
break;
case 2:
val = get_unaligned_be32(&power->update_tag) *
occ->powr_sample_time_us;
val = (u64)get_unaligned_be32(&power->update_tag) *
occ->powr_sample_time_us;
break;
case 3:
val = get_unaligned_be16(&power->value) * 1000000ULL;
Expand Down Expand Up @@ -425,8 +425,8 @@ static ssize_t occ_show_power_2(struct device *dev,
&power->update_tag);
break;
case 2:
val = get_unaligned_be32(&power->update_tag) *
occ->powr_sample_time_us;
val = (u64)get_unaligned_be32(&power->update_tag) *
occ->powr_sample_time_us;
break;
case 3:
val = get_unaligned_be16(&power->value) * 1000000ULL;
Expand Down Expand Up @@ -463,8 +463,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->system.update_tag);
break;
case 2:
val = get_unaligned_be32(&power->system.update_tag) *
occ->powr_sample_time_us;
val = (u64)get_unaligned_be32(&power->system.update_tag) *
occ->powr_sample_time_us;
break;
case 3:
val = get_unaligned_be16(&power->system.value) * 1000000ULL;
Expand All @@ -477,8 +477,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->proc.update_tag);
break;
case 6:
val = get_unaligned_be32(&power->proc.update_tag) *
occ->powr_sample_time_us;
val = (u64)get_unaligned_be32(&power->proc.update_tag) *
occ->powr_sample_time_us;
break;
case 7:
val = get_unaligned_be16(&power->proc.value) * 1000000ULL;
Expand All @@ -491,8 +491,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->vdd.update_tag);
break;
case 10:
val = get_unaligned_be32(&power->vdd.update_tag) *
occ->powr_sample_time_us;
val = (u64)get_unaligned_be32(&power->vdd.update_tag) *
occ->powr_sample_time_us;
break;
case 11:
val = get_unaligned_be16(&power->vdd.value) * 1000000ULL;
Expand All @@ -505,8 +505,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->vdn.update_tag);
break;
case 14:
val = get_unaligned_be32(&power->vdn.update_tag) *
occ->powr_sample_time_us;
val = (u64)get_unaligned_be32(&power->vdn.update_tag) *
occ->powr_sample_time_us;
break;
case 15:
val = get_unaligned_be16(&power->vdn.value) * 1000000ULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/tmp421.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = {
.data = (void *)2
},
{
.compatible = "ti,tmp422",
.compatible = "ti,tmp442",
.data = (void *)3
},
{ },
Expand Down

0 comments on commit 0a2fbed

Please sign in to comment.