diff options
-rw-r--r-- | drivers/hwmon/pmbus_core.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hwmon/pmbus_core.c b/drivers/hwmon/pmbus_core.c index 744672c1f26d..8e31a8e2c746 100644 --- a/drivers/hwmon/pmbus_core.c +++ b/drivers/hwmon/pmbus_core.c | |||
@@ -362,8 +362,8 @@ static struct pmbus_data *pmbus_update_device(struct device *dev) | |||
362 | * Convert linear sensor values to milli- or micro-units | 362 | * Convert linear sensor values to milli- or micro-units |
363 | * depending on sensor type. | 363 | * depending on sensor type. |
364 | */ | 364 | */ |
365 | static int pmbus_reg2data_linear(struct pmbus_data *data, | 365 | static long pmbus_reg2data_linear(struct pmbus_data *data, |
366 | struct pmbus_sensor *sensor) | 366 | struct pmbus_sensor *sensor) |
367 | { | 367 | { |
368 | s16 exponent; | 368 | s16 exponent; |
369 | s32 mantissa; | 369 | s32 mantissa; |
@@ -397,15 +397,15 @@ static int pmbus_reg2data_linear(struct pmbus_data *data, | |||
397 | else | 397 | else |
398 | val >>= -exponent; | 398 | val >>= -exponent; |
399 | 399 | ||
400 | return (int)val; | 400 | return val; |
401 | } | 401 | } |
402 | 402 | ||
403 | /* | 403 | /* |
404 | * Convert direct sensor values to milli- or micro-units | 404 | * Convert direct sensor values to milli- or micro-units |
405 | * depending on sensor type. | 405 | * depending on sensor type. |
406 | */ | 406 | */ |
407 | static int pmbus_reg2data_direct(struct pmbus_data *data, | 407 | static long pmbus_reg2data_direct(struct pmbus_data *data, |
408 | struct pmbus_sensor *sensor) | 408 | struct pmbus_sensor *sensor) |
409 | { | 409 | { |
410 | long val = (s16) sensor->data; | 410 | long val = (s16) sensor->data; |
411 | long m, b, R; | 411 | long m, b, R; |
@@ -440,12 +440,12 @@ static int pmbus_reg2data_direct(struct pmbus_data *data, | |||
440 | R++; | 440 | R++; |
441 | } | 441 | } |
442 | 442 | ||
443 | return (int)((val - b) / m); | 443 | return (val - b) / m; |
444 | } | 444 | } |
445 | 445 | ||
446 | static int pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor) | 446 | static long pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor) |
447 | { | 447 | { |
448 | int val; | 448 | long val; |
449 | 449 | ||
450 | if (data->info->direct[sensor->class]) | 450 | if (data->info->direct[sensor->class]) |
451 | val = pmbus_reg2data_direct(data, sensor); | 451 | val = pmbus_reg2data_direct(data, sensor); |
@@ -619,7 +619,7 @@ static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val) | |||
619 | if (!s1 && !s2) | 619 | if (!s1 && !s2) |
620 | *val = !!regval; | 620 | *val = !!regval; |
621 | else { | 621 | else { |
622 | int v1, v2; | 622 | long v1, v2; |
623 | struct pmbus_sensor *sensor1, *sensor2; | 623 | struct pmbus_sensor *sensor1, *sensor2; |
624 | 624 | ||
625 | sensor1 = &data->sensors[s1]; | 625 | sensor1 = &data->sensors[s1]; |
@@ -661,7 +661,7 @@ static ssize_t pmbus_show_sensor(struct device *dev, | |||
661 | if (sensor->data < 0) | 661 | if (sensor->data < 0) |
662 | return sensor->data; | 662 | return sensor->data; |
663 | 663 | ||
664 | return snprintf(buf, PAGE_SIZE, "%d\n", pmbus_reg2data(data, sensor)); | 664 | return snprintf(buf, PAGE_SIZE, "%ld\n", pmbus_reg2data(data, sensor)); |
665 | } | 665 | } |
666 | 666 | ||
667 | static ssize_t pmbus_set_sensor(struct device *dev, | 667 | static ssize_t pmbus_set_sensor(struct device *dev, |