* [PATCH] ACPI: battery drivers should call power_supply_changed()
@ 2009-05-12 14:50 Alan Jenkins
0 siblings, 0 replies; only message in thread
From: Alan Jenkins @ 2009-05-12 14:50 UTC (permalink / raw)
To: linux acpi; +Cc: Alexey Starikovskiy
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>
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 2ccc87e..9208e97 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -812,7 +812,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
#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
}
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 4b214b7..dfa9455 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -890,7 +890,7 @@ static void acpi_sbs_callback(void *context)
sbs->charger_present);
#endif
#ifdef CONFIG_ACPI_SYSFS_POWER
- kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE);
+ power_supply_changed(&sbs->charger);
#endif
}
if (sbs->manager_present) {
@@ -909,7 +909,7 @@ static void acpi_sbs_callback(void *context)
bat->present);
#endif
#ifdef CONFIG_ACPI_SYSFS_POWER
- kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE);
+ power_supply_changed(&bat->bat);
#endif
}
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-12 14:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-12 14:50 [PATCH] 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