diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-15 20:33:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-15 20:33:13 -0400 |
commit | 92fbb1c9179052a81b74420d4695db2be9a5fe0e (patch) | |
tree | 60b980c4aace2c2bf5e28943d0ea0eaae64db353 | |
parent | 1d9d8639c063caf6efc2447f5f26aa637f844ff6 (diff) | |
parent | 8c958c703ef8804093437959221951eaf0e1e664 (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:
"Bug fixes for pmbus, ltc2978, and lineage-pem drivers
Added specific maintainer for some hwmon drivers"
* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (pmbus/ltc2978) Fix temperature reporting
hwmon: (pmbus) Fix krealloc() misuse in pmbus_add_attribute()
hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes
MAINTAINERS: Add maintainer for MAX6697, INA209, and INA2XX drivers
-rw-r--r-- | MAINTAINERS | 25 | ||||
-rw-r--r-- | drivers/hwmon/lineage-pem.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/ltc2978.c | 14 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/pmbus_core.c | 12 |
4 files changed, 42 insertions, 11 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index c08411b27499..50b4d735f961 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4005,6 +4005,22 @@ M: Stanislaw Gruszka <stf_xl@wp.pl> | |||
4005 | S: Maintained | 4005 | S: Maintained |
4006 | F: drivers/usb/atm/ueagle-atm.c | 4006 | F: drivers/usb/atm/ueagle-atm.c |
4007 | 4007 | ||
4008 | INA209 HARDWARE MONITOR DRIVER | ||
4009 | M: Guenter Roeck <linux@roeck-us.net> | ||
4010 | L: lm-sensors@lm-sensors.org | ||
4011 | S: Maintained | ||
4012 | F: Documentation/hwmon/ina209 | ||
4013 | F: Documentation/devicetree/bindings/i2c/ina209.txt | ||
4014 | F: drivers/hwmon/ina209.c | ||
4015 | |||
4016 | INA2XX HARDWARE MONITOR DRIVER | ||
4017 | M: Guenter Roeck <linux@roeck-us.net> | ||
4018 | L: lm-sensors@lm-sensors.org | ||
4019 | S: Maintained | ||
4020 | F: Documentation/hwmon/ina2xx | ||
4021 | F: drivers/hwmon/ina2xx.c | ||
4022 | F: include/linux/platform_data/ina2xx.h | ||
4023 | |||
4008 | INDUSTRY PACK SUBSYSTEM (IPACK) | 4024 | INDUSTRY PACK SUBSYSTEM (IPACK) |
4009 | M: Samuel Iglesias Gonsalvez <siglesias@igalia.com> | 4025 | M: Samuel Iglesias Gonsalvez <siglesias@igalia.com> |
4010 | M: Jens Taprogge <jens.taprogge@taprogge.org> | 4026 | M: Jens Taprogge <jens.taprogge@taprogge.org> |
@@ -5098,6 +5114,15 @@ S: Maintained | |||
5098 | F: Documentation/hwmon/max6650 | 5114 | F: Documentation/hwmon/max6650 |
5099 | F: drivers/hwmon/max6650.c | 5115 | F: drivers/hwmon/max6650.c |
5100 | 5116 | ||
5117 | MAX6697 HARDWARE MONITOR DRIVER | ||
5118 | M: Guenter Roeck <linux@roeck-us.net> | ||
5119 | L: lm-sensors@lm-sensors.org | ||
5120 | S: Maintained | ||
5121 | F: Documentation/hwmon/max6697 | ||
5122 | F: Documentation/devicetree/bindings/i2c/max6697.txt | ||
5123 | F: drivers/hwmon/max6697.c | ||
5124 | F: include/linux/platform_data/max6697.h | ||
5125 | |||
5101 | MAXIRADIO FM RADIO RECEIVER DRIVER | 5126 | MAXIRADIO FM RADIO RECEIVER DRIVER |
5102 | M: Hans Verkuil <hverkuil@xs4all.nl> | 5127 | M: Hans Verkuil <hverkuil@xs4all.nl> |
5103 | L: linux-media@vger.kernel.org | 5128 | L: linux-media@vger.kernel.org |
diff --git a/drivers/hwmon/lineage-pem.c b/drivers/hwmon/lineage-pem.c index 41df29f59b0e..ebbb9f4f27a3 100644 --- a/drivers/hwmon/lineage-pem.c +++ b/drivers/hwmon/lineage-pem.c | |||
@@ -422,6 +422,7 @@ static struct attribute *pem_input_attributes[] = { | |||
422 | &sensor_dev_attr_in2_input.dev_attr.attr, | 422 | &sensor_dev_attr_in2_input.dev_attr.attr, |
423 | &sensor_dev_attr_curr1_input.dev_attr.attr, | 423 | &sensor_dev_attr_curr1_input.dev_attr.attr, |
424 | &sensor_dev_attr_power1_input.dev_attr.attr, | 424 | &sensor_dev_attr_power1_input.dev_attr.attr, |
425 | NULL | ||
425 | }; | 426 | }; |
426 | 427 | ||
427 | static const struct attribute_group pem_input_group = { | 428 | static const struct attribute_group pem_input_group = { |
@@ -432,6 +433,7 @@ static struct attribute *pem_fan_attributes[] = { | |||
432 | &sensor_dev_attr_fan1_input.dev_attr.attr, | 433 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
433 | &sensor_dev_attr_fan2_input.dev_attr.attr, | 434 | &sensor_dev_attr_fan2_input.dev_attr.attr, |
434 | &sensor_dev_attr_fan3_input.dev_attr.attr, | 435 | &sensor_dev_attr_fan3_input.dev_attr.attr, |
436 | NULL | ||
435 | }; | 437 | }; |
436 | 438 | ||
437 | static const struct attribute_group pem_fan_group = { | 439 | static const struct attribute_group pem_fan_group = { |
diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c index a58de38e23d8..6d6130752f94 100644 --- a/drivers/hwmon/pmbus/ltc2978.c +++ b/drivers/hwmon/pmbus/ltc2978.c | |||
@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 }; | |||
59 | struct ltc2978_data { | 59 | struct ltc2978_data { |
60 | enum chips id; | 60 | enum chips id; |
61 | int vin_min, vin_max; | 61 | int vin_min, vin_max; |
62 | int temp_min, temp_max; | 62 | int temp_min, temp_max[2]; |
63 | int vout_min[8], vout_max[8]; | 63 | int vout_min[8], vout_max[8]; |
64 | int iout_max[2]; | 64 | int iout_max[2]; |
65 | int temp2_max; | 65 | int temp2_max; |
@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page, | |||
113 | ret = pmbus_read_word_data(client, page, | 113 | ret = pmbus_read_word_data(client, page, |
114 | LTC2978_MFR_TEMPERATURE_PEAK); | 114 | LTC2978_MFR_TEMPERATURE_PEAK); |
115 | if (ret >= 0) { | 115 | if (ret >= 0) { |
116 | if (lin11_to_val(ret) > lin11_to_val(data->temp_max)) | 116 | if (lin11_to_val(ret) |
117 | data->temp_max = ret; | 117 | > lin11_to_val(data->temp_max[page])) |
118 | ret = data->temp_max; | 118 | data->temp_max[page] = ret; |
119 | ret = data->temp_max[page]; | ||
119 | } | 120 | } |
120 | break; | 121 | break; |
121 | case PMBUS_VIRT_RESET_VOUT_HISTORY: | 122 | case PMBUS_VIRT_RESET_VOUT_HISTORY: |
@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page, | |||
266 | break; | 267 | break; |
267 | case PMBUS_VIRT_RESET_TEMP_HISTORY: | 268 | case PMBUS_VIRT_RESET_TEMP_HISTORY: |
268 | data->temp_min = 0x7bff; | 269 | data->temp_min = 0x7bff; |
269 | data->temp_max = 0x7c00; | 270 | data->temp_max[page] = 0x7c00; |
270 | ret = ltc2978_clear_peaks(client, page, data->id); | 271 | ret = ltc2978_clear_peaks(client, page, data->id); |
271 | break; | 272 | break; |
272 | default: | 273 | default: |
@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client, | |||
323 | data->vin_min = 0x7bff; | 324 | data->vin_min = 0x7bff; |
324 | data->vin_max = 0x7c00; | 325 | data->vin_max = 0x7c00; |
325 | data->temp_min = 0x7bff; | 326 | data->temp_min = 0x7bff; |
326 | data->temp_max = 0x7c00; | 327 | for (i = 0; i < ARRAY_SIZE(data->temp_max); i++) |
328 | data->temp_max[i] = 0x7c00; | ||
327 | data->temp2_max = 0x7c00; | 329 | data->temp2_max = 0x7c00; |
328 | 330 | ||
329 | switch (data->id) { | 331 | switch (data->id) { |
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 80eef50c50fd..9add60920ac0 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c | |||
@@ -766,12 +766,14 @@ static ssize_t pmbus_show_label(struct device *dev, | |||
766 | static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) | 766 | static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) |
767 | { | 767 | { |
768 | if (data->num_attributes >= data->max_attributes - 1) { | 768 | if (data->num_attributes >= data->max_attributes - 1) { |
769 | data->max_attributes += PMBUS_ATTR_ALLOC_SIZE; | 769 | int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE; |
770 | data->group.attrs = krealloc(data->group.attrs, | 770 | void *new_attrs = krealloc(data->group.attrs, |
771 | sizeof(struct attribute *) * | 771 | new_max_attrs * sizeof(void *), |
772 | data->max_attributes, GFP_KERNEL); | 772 | GFP_KERNEL); |
773 | if (data->group.attrs == NULL) | 773 | if (!new_attrs) |
774 | return -ENOMEM; | 774 | return -ENOMEM; |
775 | data->group.attrs = new_attrs; | ||
776 | data->max_attributes = new_max_attrs; | ||
775 | } | 777 | } |
776 | 778 | ||
777 | data->group.attrs[data->num_attributes++] = attr; | 779 | data->group.attrs[data->num_attributes++] = attr; |