diff mbox

ACPI: battery drivers should call power_supply_changed()

Message ID 4A098CD2.2030608@tuffmail.co.uk (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Alan Jenkins May 12, 2009, 2:50 p.m. UTC
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>



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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
 		}
 	}