OSDN Git Service

Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / mfd / ab8500-sysctrl.c
index cfff0b6..0d18256 100644 (file)
@@ -49,7 +49,9 @@ static void ab8500_power_off(void)
                if (!psy)
                        continue;
 
-               ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val);
+               ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE,
+                               &val);
+               power_supply_put(psy);
 
                if (!ret && val.intval) {
                        charger_present = true;
@@ -63,8 +65,8 @@ static void ab8500_power_off(void)
        /* Check if battery is known */
        psy = power_supply_get_by_name("ab8500_btemp");
        if (psy) {
-               ret = psy->get_property(psy, POWER_SUPPLY_PROP_TECHNOLOGY,
-                                       &val);
+               ret = power_supply_get_property(psy,
+                               POWER_SUPPLY_PROP_TECHNOLOGY, &val);
                if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) {
                        printk(KERN_INFO
                               "Charger \"%s\" is connected with known battery."
@@ -72,6 +74,7 @@ static void ab8500_power_off(void)
                               pss[i]);
                        machine_restart("charging");
                }
+               power_supply_put(psy);
        }
 
 shutdown: