power: supply: act8945a_charger: Remove "battery_temperature"
authorWenyou Yang <wenyou.yang@atmel.com>
Thu, 25 Aug 2016 07:19:51 +0000 (15:19 +0800)
committerSebastian Reichel <sre@kernel.org>
Wed, 31 Aug 2016 14:46:50 +0000 (16:46 +0200)
Remove "battery_temperature" member, it is redundant, it is the
hardware's responsibility to handle TH pin properly.
It is unnecessary to use the dt property to check if there is
a battery temperature monitor or not.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/act8945a_charger.c

index 3f486c9362c889e804b0b7e950e74b32c7086720..af006680dd5ce9a8b2183b798fb077b65bacf785 100644 (file)
@@ -76,7 +76,6 @@ static const char *act8945a_charger_manufacturer = "Active-semi";
 
 struct act8945a_charger {
        struct regmap *regmap;
-       bool battery_temperature;
 };
 
 static int act8945a_get_charger_state(struct regmap *regmap, int *val)
@@ -138,8 +137,7 @@ static int act8945a_get_charge_type(struct regmap *regmap, int *val)
        return 0;
 }
 
-static int act8945a_get_battery_health(struct act8945a_charger *charger,
-                                      struct regmap *regmap, int *val)
+static int act8945a_get_battery_health(struct regmap *regmap, int *val)
 {
        int ret;
        unsigned int status;
@@ -148,7 +146,7 @@ static int act8945a_get_battery_health(struct act8945a_charger *charger,
        if (ret < 0)
                return ret;
 
-       if (charger->battery_temperature && !(status & APCH_STATUS_TEMPDAT))
+       if (!(status & APCH_STATUS_TEMPDAT))
                *val = POWER_SUPPLY_HEALTH_OVERHEAT;
        else if (!(status & APCH_STATUS_INDAT))
                *val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
@@ -188,8 +186,7 @@ static int act8945a_charger_get_property(struct power_supply *psy,
                val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
                break;
        case POWER_SUPPLY_PROP_HEALTH:
-               ret = act8945a_get_battery_health(charger,
-                                                 regmap, &val->intval);
+               ret = act8945a_get_battery_health(regmap, &val->intval);
                break;
        case POWER_SUPPLY_PROP_MODEL_NAME:
                val->strval = act8945a_charger_model;
@@ -235,9 +232,6 @@ static int act8945a_charger_config(struct device *dev,
                return -EINVAL;
        }
 
-       charger->battery_temperature = of_property_read_bool(np,
-                               "active-semi,check-battery-temperature");
-
        chglev_pin = of_get_named_gpio_flags(np,
                                "active-semi,chglev-gpios", 0, &flags);