diff options
| -rw-r--r-- | drivers/power/power_supply_core.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 456987c88baa..b13cd074c52a 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c | |||
| @@ -565,11 +565,12 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd, | |||
| 565 | 565 | ||
| 566 | WARN_ON(tzd == NULL); | 566 | WARN_ON(tzd == NULL); |
| 567 | psy = tzd->devdata; | 567 | psy = tzd->devdata; |
| 568 | ret = psy->desc->get_property(psy, POWER_SUPPLY_PROP_TEMP, &val); | 568 | ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_TEMP, &val); |
| 569 | if (ret) | ||
| 570 | return ret; | ||
| 569 | 571 | ||
| 570 | /* Convert tenths of degree Celsius to milli degree Celsius. */ | 572 | /* Convert tenths of degree Celsius to milli degree Celsius. */ |
| 571 | if (!ret) | 573 | *temp = val.intval * 100; |
| 572 | *temp = val.intval * 100; | ||
| 573 | 574 | ||
| 574 | return ret; | 575 | return ret; |
| 575 | } | 576 | } |
| @@ -612,10 +613,12 @@ static int ps_get_max_charge_cntl_limit(struct thermal_cooling_device *tcd, | |||
| 612 | int ret; | 613 | int ret; |
| 613 | 614 | ||
| 614 | psy = tcd->devdata; | 615 | psy = tcd->devdata; |
| 615 | ret = psy->desc->get_property(psy, | 616 | ret = power_supply_get_property(psy, |
| 616 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX, &val); | 617 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX, &val); |
| 617 | if (!ret) | 618 | if (ret) |
| 618 | *state = val.intval; | 619 | return ret; |
| 620 | |||
| 621 | *state = val.intval; | ||
| 619 | 622 | ||
| 620 | return ret; | 623 | return ret; |
| 621 | } | 624 | } |
| @@ -628,10 +631,12 @@ static int ps_get_cur_chrage_cntl_limit(struct thermal_cooling_device *tcd, | |||
| 628 | int ret; | 631 | int ret; |
| 629 | 632 | ||
| 630 | psy = tcd->devdata; | 633 | psy = tcd->devdata; |
| 631 | ret = psy->desc->get_property(psy, | 634 | ret = power_supply_get_property(psy, |
| 632 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT, &val); | 635 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT, &val); |
| 633 | if (!ret) | 636 | if (ret) |
| 634 | *state = val.intval; | 637 | return ret; |
| 638 | |||
| 639 | *state = val.intval; | ||
| 635 | 640 | ||
| 636 | return ret; | 641 | return ret; |
| 637 | } | 642 | } |
