提交 15077fc1 编写于 作者: K Krzysztof Kozlowski 提交者: Sebastian Reichel

power_supply: ab8500: Use power_supply_*() API for accessing function attrs

Replace direct calls to power supply function attributes with wrappers.
Wrappers provide safe access in case of unregistering the power
supply (e.g. by removing the driver). Replace:
 - get_property -> power_supply_get_property
Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: NJonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: NPavel Machek <pavel@ucw.cz>
Acked-by: NLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: NSebastian Reichel <sre@kernel.org>
Signed-off-by: NSebastian Reichel <sre@kernel.org>
上级 465c436b
...@@ -938,7 +938,7 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data) ...@@ -938,7 +938,7 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)
enum power_supply_property prop; enum power_supply_property prop;
prop = ext->properties[j]; prop = ext->properties[j];
if (ext->get_property(ext, prop, &ret)) if (power_supply_get_property(ext, prop, &ret))
continue; continue;
switch (prop) { switch (prop) {
......
...@@ -1957,7 +1957,7 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data) ...@@ -1957,7 +1957,7 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data)
enum power_supply_property prop; enum power_supply_property prop;
prop = ext->properties[j]; prop = ext->properties[j];
if (ext->get_property(ext, prop, &ret)) if (power_supply_get_property(ext, prop, &ret))
continue; continue;
switch (prop) { switch (prop) {
......
...@@ -2200,7 +2200,7 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) ...@@ -2200,7 +2200,7 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data)
enum power_supply_property prop; enum power_supply_property prop;
prop = ext->properties[j]; prop = ext->properties[j];
if (ext->get_property(ext, prop, &ret)) if (power_supply_get_property(ext, prop, &ret))
continue; continue;
switch (prop) { switch (prop) {
......
...@@ -1001,7 +1001,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) ...@@ -1001,7 +1001,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data)
* property because of handling that sysfs entry on its own, this is * property because of handling that sysfs entry on its own, this is
* the place to get the battery capacity. * the place to get the battery capacity.
*/ */
if (!ext->get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) { if (!power_supply_get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) {
di->batt_data.percent = ret.intval; di->batt_data.percent = ret.intval;
capacity_updated = true; capacity_updated = true;
} }
...@@ -1019,7 +1019,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) ...@@ -1019,7 +1019,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data)
ext->type == POWER_SUPPLY_TYPE_USB) ext->type == POWER_SUPPLY_TYPE_USB)
di->usb_chg = psy_to_ux500_charger(ext); di->usb_chg = psy_to_ux500_charger(ext);
if (ext->get_property(ext, prop, &ret)) if (power_supply_get_property(ext, prop, &ret))
continue; continue;
switch (prop) { switch (prop) {
case POWER_SUPPLY_PROP_PRESENT: case POWER_SUPPLY_PROP_PRESENT:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册