Commit 0a2fbed8 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-v5.0-rc3' of...

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
parents a3a80255 f422449b
...@@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, ...@@ -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); rv = lm80_read_value(client, LM80_REG_FANDIV);
if (rv < 0) if (rv < 0) {
mutex_unlock(&data->update_lock);
return rv; return rv;
}
reg = (rv & ~(3 << (2 * (nr + 1)))) reg = (rv & ~(3 << (2 * (nr + 1))))
| (data->fan_div[nr] << (2 * (nr + 1))); | (data->fan_div[nr] << (2 * (nr + 1)));
lm80_write_value(client, LM80_REG_FANDIV, reg); lm80_write_value(client, LM80_REG_FANDIV, reg);
......
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
* nct6796d 14 7 7 2+6 0xd420 0xc1 0x5ca3 * nct6796d 14 7 7 2+6 0xd420 0xc1 0x5ca3
* nct6797d 14 7 7 2+6 0xd450 0xc1 0x5ca3 * nct6797d 14 7 7 2+6 0xd450 0xc1 0x5ca3
* (0xd451) * (0xd451)
* nct6798d 14 7 7 2+6 0xd458 0xc1 0x5ca3 * nct6798d 14 7 7 2+6 0xd428 0xc1 0x5ca3
* (0xd459) * (0xd429)
* *
* #temp lists the number of monitored temperature sources (first value) plus * #temp lists the number of monitored temperature sources (first value) plus
* the number of directly connectable temperature sensors (second value). * the number of directly connectable temperature sensors (second value).
...@@ -138,7 +138,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal"); ...@@ -138,7 +138,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
#define SIO_NCT6795_ID 0xd350 #define SIO_NCT6795_ID 0xd350
#define SIO_NCT6796_ID 0xd420 #define SIO_NCT6796_ID 0xd420
#define SIO_NCT6797_ID 0xd450 #define SIO_NCT6797_ID 0xd450
#define SIO_NCT6798_ID 0xd458 #define SIO_NCT6798_ID 0xd428
#define SIO_ID_MASK 0xFFF8 #define SIO_ID_MASK 0xFFF8
enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 }; enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 };
...@@ -4508,7 +4508,8 @@ static int __maybe_unused nct6775_resume(struct device *dev) ...@@ -4508,7 +4508,8 @@ static int __maybe_unused nct6775_resume(struct device *dev)
if (data->kind == nct6791 || data->kind == nct6792 || if (data->kind == nct6791 || data->kind == nct6792 ||
data->kind == nct6793 || data->kind == nct6795 || data->kind == nct6793 || data->kind == nct6795 ||
data->kind == nct6796) data->kind == nct6796 || data->kind == nct6797 ||
data->kind == nct6798)
nct6791_enable_io_mapping(sioreg); nct6791_enable_io_mapping(sioreg);
superio_exit(sioreg); superio_exit(sioreg);
...@@ -4644,7 +4645,8 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) ...@@ -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 || if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
sio_data->kind == nct6793 || sio_data->kind == nct6795 || 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); nct6791_enable_io_mapping(sioaddr);
superio_exit(sioaddr); superio_exit(sioaddr);
......
...@@ -380,8 +380,8 @@ static ssize_t occ_show_power_1(struct device *dev, ...@@ -380,8 +380,8 @@ static ssize_t occ_show_power_1(struct device *dev,
val *= 1000000ULL; val *= 1000000ULL;
break; break;
case 2: case 2:
val = get_unaligned_be32(&power->update_tag) * val = (u64)get_unaligned_be32(&power->update_tag) *
occ->powr_sample_time_us; occ->powr_sample_time_us;
break; break;
case 3: case 3:
val = get_unaligned_be16(&power->value) * 1000000ULL; val = get_unaligned_be16(&power->value) * 1000000ULL;
...@@ -425,8 +425,8 @@ static ssize_t occ_show_power_2(struct device *dev, ...@@ -425,8 +425,8 @@ static ssize_t occ_show_power_2(struct device *dev,
&power->update_tag); &power->update_tag);
break; break;
case 2: case 2:
val = get_unaligned_be32(&power->update_tag) * val = (u64)get_unaligned_be32(&power->update_tag) *
occ->powr_sample_time_us; occ->powr_sample_time_us;
break; break;
case 3: case 3:
val = get_unaligned_be16(&power->value) * 1000000ULL; val = get_unaligned_be16(&power->value) * 1000000ULL;
...@@ -463,8 +463,8 @@ static ssize_t occ_show_power_a0(struct device *dev, ...@@ -463,8 +463,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->system.update_tag); &power->system.update_tag);
break; break;
case 2: case 2:
val = get_unaligned_be32(&power->system.update_tag) * val = (u64)get_unaligned_be32(&power->system.update_tag) *
occ->powr_sample_time_us; occ->powr_sample_time_us;
break; break;
case 3: case 3:
val = get_unaligned_be16(&power->system.value) * 1000000ULL; val = get_unaligned_be16(&power->system.value) * 1000000ULL;
...@@ -477,8 +477,8 @@ static ssize_t occ_show_power_a0(struct device *dev, ...@@ -477,8 +477,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->proc.update_tag); &power->proc.update_tag);
break; break;
case 6: case 6:
val = get_unaligned_be32(&power->proc.update_tag) * val = (u64)get_unaligned_be32(&power->proc.update_tag) *
occ->powr_sample_time_us; occ->powr_sample_time_us;
break; break;
case 7: case 7:
val = get_unaligned_be16(&power->proc.value) * 1000000ULL; val = get_unaligned_be16(&power->proc.value) * 1000000ULL;
...@@ -491,8 +491,8 @@ static ssize_t occ_show_power_a0(struct device *dev, ...@@ -491,8 +491,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->vdd.update_tag); &power->vdd.update_tag);
break; break;
case 10: case 10:
val = get_unaligned_be32(&power->vdd.update_tag) * val = (u64)get_unaligned_be32(&power->vdd.update_tag) *
occ->powr_sample_time_us; occ->powr_sample_time_us;
break; break;
case 11: case 11:
val = get_unaligned_be16(&power->vdd.value) * 1000000ULL; val = get_unaligned_be16(&power->vdd.value) * 1000000ULL;
...@@ -505,8 +505,8 @@ static ssize_t occ_show_power_a0(struct device *dev, ...@@ -505,8 +505,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
&power->vdn.update_tag); &power->vdn.update_tag);
break; break;
case 14: case 14:
val = get_unaligned_be32(&power->vdn.update_tag) * val = (u64)get_unaligned_be32(&power->vdn.update_tag) *
occ->powr_sample_time_us; occ->powr_sample_time_us;
break; break;
case 15: case 15:
val = get_unaligned_be16(&power->vdn.value) * 1000000ULL; val = get_unaligned_be16(&power->vdn.value) * 1000000ULL;
......
...@@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = { ...@@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = {
.data = (void *)2 .data = (void *)2
}, },
{ {
.compatible = "ti,tmp422", .compatible = "ti,tmp442",
.data = (void *)3 .data = (void *)3
}, },
{ }, { },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment