[BATTERY] Fix status_caps for AC supplies to 'on-line' not 'present'

David Woodhouse dwmw2 at infradead.org
Tue Nov 7 22:38:26 EST 2006


Commit:     a32c64abd76ded9d5768953863647cc76290d2bb
Parent:     df2ddf7859840fc9ff15809aa04e6c59a90622ad
commit a32c64abd76ded9d5768953863647cc76290d2bb
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Wed Oct 25 17:51:08 2006 +0300
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Wed Oct 25 17:51:08 2006 +0300

    [BATTERY] Fix status_caps for AC supplies to 'on-line' not 'present'
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/battery/battery-class.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/battery/battery-class.c b/drivers/battery/battery-class.c
index 63ba036..a09357f 100644
--- a/drivers/battery/battery-class.c
+++ b/drivers/battery/battery-class.c
@@ -76,7 +76,12 @@ static ssize_t battery_attribute_show_ca
 {
 	struct battery_dev *battery_dev = dev_get_drvdata(dev);
 
-	return battery_attribute_show_status(buf, battery_dev->status_cap);
+	if (battery_dev->type == PWRDEV_TYPE_AC)
+		return battery_attribute_show_ac_status(buf,
+						     battery_dev->status_cap);
+	else
+		return battery_attribute_show_status(buf,
+						     battery_dev->status_cap);
 }
 
 static ssize_t battery_attribute_show_name(struct device *dev,


More information about the Commits-kernel mailing list