aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <agreen@octopus.localdomain>2009-01-28 15:53:26 +0000
committerAndy Green <agreen@octopus.localdomain>2009-01-28 15:53:26 +0000
commit27692fc9f6238c81146a0fb3e1a5c27d87825819 (patch)
treeb63e8f71855281fec769d3fc25c227fd85cb3b4d
parent550164983562201af4b425dc731bed6287a5a80f (diff)
From: Sean McNeil <sean@mcneil.com>
fix-ac-redefinition.patch
-rw-r--r--drivers/power/bq27000_battery.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c
index ccd56ea137c..bc2bd1c70f0 100644
--- a/drivers/power/bq27000_battery.c
+++ b/drivers/power/bq27000_battery.c
@@ -336,54 +336,6 @@ static void bq27000_battery_work(struct work_struct *work)
dev_err(di->dev, "battery service reschedule failed\n");
}
-static int ac_get_property(struct power_supply *psy,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- int ret = 0;
- struct bq27000_device_info *di = container_of(psy, struct bq27000_device_info, ac);
-
- if (!(di->pdata->hdq_initialized)())
- return -EINVAL;
-
- switch (psp) {
- case POWER_SUPPLY_PROP_ONLINE:
- if (di->pdata->get_charger_online_status)
- val->intval = (di->pdata->get_charger_online_status)();
- else
- return -EINVAL;
- break;
- default:
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
-static int usb_get_property(struct power_supply *psy,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- int ret = 0;
- struct bq27000_device_info *di = container_of(psy, struct bq27000_device_info, usb);
-
- if (!(di->pdata->hdq_initialized)())
- return -EINVAL;
-
- switch (psp) {
- case POWER_SUPPLY_PROP_ONLINE:
- if (di->pdata->get_charger_online_status)
- val->intval = (di->pdata->get_charger_online_status)();
- else
- return -EINVAL;
- break;
- default:
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
static enum power_supply_property bq27000_battery_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_HEALTH,
@@ -399,10 +351,6 @@ static enum power_supply_property bq27000_battery_props[] = {
POWER_SUPPLY_PROP_ONLINE
};
-static enum power_supply_property power_props[] = {
- POWER_SUPPLY_PROP_ONLINE,
-};
-
static int bq27000_battery_probe(struct platform_device *pdev)
{
int retval = 0;
@@ -432,36 +380,12 @@ static int bq27000_battery_probe(struct platform_device *pdev)
di->bat.use_for_apm = 1;
di->pdata = pdata;
- di->ac.name = "ac";
- di->ac.type = POWER_SUPPLY_TYPE_MAINS;
- di->ac.properties = power_props;
- di->ac.num_properties = ARRAY_SIZE(power_props);
- di->ac.get_property = ac_get_property;
-
- di->usb.name = "usb";
- di->usb.type = POWER_SUPPLY_TYPE_USB;
- di->usb.properties = power_props;
- di->usb.num_properties = ARRAY_SIZE(power_props);
- di->usb.get_property = usb_get_property;
-
retval = power_supply_register(&pdev->dev, &di->bat);
if (retval) {
dev_err(di->dev, "failed to register battery\n");
goto batt_failed;
}
- retval = power_supply_register(&pdev->dev, &di->ac);
- if (retval) {
- dev_err(di->dev, "failed to register ac\n");
- goto ac_failed;
- }
-
- retval = power_supply_register(&pdev->dev, &di->usb);
- if (retval) {
- dev_err(di->dev, "failed to register usb\n");
- goto usb_failed;
- }
-
INIT_DELAYED_WORK(&di->work, bq27000_battery_work);
if (!schedule_delayed_work(&di->work, 0))
@@ -469,10 +393,6 @@ static int bq27000_battery_probe(struct platform_device *pdev)
return 0;
-usb_failed:
- power_supply_unregister(&di->ac);
-ac_failed:
- power_supply_unregister(&di->bat);
batt_failed:
kfree(di);
di_alloc_failed:
@@ -486,8 +406,6 @@ static int bq27000_battery_remove(struct platform_device *pdev)
cancel_delayed_work(&di->work);
power_supply_unregister(&di->bat);
- power_supply_unregister(&di->ac);
- power_supply_unregister(&di->usb);
return 0;
}
@@ -498,9 +416,6 @@ void bq27000_charging_state_change(struct platform_device *pdev)
if (!di)
return;
-
- power_supply_changed(&di->ac);
- power_supply_changed(&di->usb);
}
EXPORT_SYMBOL_GPL(bq27000_charging_state_change);