--Boundary-01=_H12IHT5Jl25MIH1
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I am not exactly sure about this one ... what other power_supply class driv=
ers=20
do? Should I fix HAL instead (but then, I do not know whether HAL is the on=
ly=20
application that is using this interface).
--Boundary-01=_H12IHT5Jl25MIH1
Content-Type: text/x-diff;
charset="us-ascii";
name="2.6.24-rc1_battery_present_property"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="2.6.24-rc1_battery_present_property"
Subject: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if batte=
ry is absent
=46rom: Andrey Borzenkov <arvidjaar@mail.ru>
Ensure that we always have "present" attribute in sysfs. This is compatible
with procfs case where we had "present: no" if battery was not available.
This fixes HAL battery detection where it does pretend battery is present
but canot provide any value for it.
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
=2D--
drivers/acpi/battery.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 681e26b..6e67fcd 100644
=2D-- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -187,6 +187,10 @@ static int acpi_battery_get_property(struct power_supp=
ly *psy,
return 0;
}
=20
+static enum power_supply_property missing_battery_props[] =3D {
+ POWER_SUPPLY_PROP_PRESENT,
+};
+
static enum power_supply_property charge_battery_props[] =3D {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_PRESENT,
@@ -389,8 +393,13 @@ static int acpi_battery_update(struct acpi_battery *ba=
ttery)
{
int saved_present =3D acpi_battery_present(battery);
int result =3D acpi_battery_get_status(battery);
=2D if (result || !acpi_battery_present(battery))
+ if (result)
return result;
+ if (!acpi_battery_present(battery)) {
+ battery->bat.properties =3D missing_battery_props;
+ battery->bat.num_properties =3D ARRAY_SIZE(missing_battery_props);
+ return result;
+ }
if (saved_present !=3D acpi_battery_present(battery) ||
!battery->update_time) {
battery->update_time =3D 0;
--Boundary-01=_H12IHT5Jl25MIH1--| Washington Odhiambo | Weird Problem with NAT - more details |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Andrew Morton | -mm merge plans for 2.6.23 |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | Re: [GIT]: Networking |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
