* [PATCH 1/2] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
@ 2009-12-11 11:04 Alan Jenkins
2009-12-11 11:05 ` [PATCH 2/2] ACPI: battery drivers should call power_supply_changed() Alan Jenkins
0 siblings, 1 reply; 2+ messages in thread
From: Alan Jenkins @ 2009-12-11 11:04 UTC (permalink / raw)
To: Len Brown; +Cc: linux acpi
Disabling CONFIG_ACPI_SYSFS_POWER changes the behaviour of
acpi_battery_update(). It will call acpi_battery_get_info()
even if the battery is not present. I haven't noticed this
causing any problem, but it does look like a bad idea.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
CC: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/battery.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 3f4602b..ed4aeab 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -522,13 +522,13 @@ static int acpi_battery_update(struct acpi_battery *battery)
result = acpi_battery_get_status(battery);
if (result)
return result;
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (!acpi_battery_present(battery)) {
+#ifdef CONFIG_ACPI_SYSFS_POWER
sysfs_remove_battery(battery);
+#endif
battery->update_time = 0;
return 0;
}
-#endif
if (!battery->update_time ||
old_present != acpi_battery_present(battery)) {
result = acpi_battery_get_info(battery);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] ACPI: battery drivers should call power_supply_changed()
2009-12-11 11:04 [PATCH 1/2] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n Alan Jenkins
@ 2009-12-11 11:05 ` Alan Jenkins
0 siblings, 0 replies; 2+ messages in thread
From: Alan Jenkins @ 2009-12-11 11:05 UTC (permalink / raw)
To: Len Brown; +Cc: linux acpi
Calling kobject_uevent() directly is a layering violation. In
particular, it means we'll miss updating the generic LED trigger.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
CC: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/battery.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index ed4aeab..ec3138c 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -833,7 +833,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
#ifdef CONFIG_ACPI_SYSFS_POWER
/* acpi_batter_update could remove power_supply object */
if (battery->bat.dev)
- kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE);
+ power_supply_changed(&battery->bat);
#endif
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-11 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 11:04 [PATCH 1/2] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n Alan Jenkins
2009-12-11 11:05 ` [PATCH 2/2] ACPI: battery drivers should call power_supply_changed() Alan Jenkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox