Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ac62f52

Browse files
t-8chrafaeljw
authored andcommitted
ACPI: AC: Properly notify powermanagement core about changes
The powermanagement core does various actions when a powersupply changes. It calls into notifiers, LED triggers, other power supplies and emits an uevent. To make sure that all these actions happen properly call power_supply_changed(). Reported-by: Rajas Paranjpe <paranjperajas@gmail.com> Closes: MrChromebox/firmware#420 (comment) Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1613e60 commit ac62f52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/acpi/ac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
145145
dev_name(&adev->dev), event,
146146
(u32) ac->state);
147147
acpi_notifier_call_chain(adev, event, (u32) ac->state);
148-
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
148+
power_supply_changed(ac->charger);
149149
}
150150
}
151151

@@ -268,7 +268,7 @@ static int acpi_ac_resume(struct device *dev)
268268
if (acpi_ac_get_state(ac))
269269
return 0;
270270
if (old_state != ac->state)
271-
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
271+
power_supply_changed(ac->charger);
272272

273273
return 0;
274274
}

drivers/acpi/sbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ static void acpi_sbs_callback(void *context)
610610
if (sbs->charger_exists) {
611611
acpi_ac_get_present(sbs);
612612
if (sbs->charger_present != saved_charger_state)
613-
kobject_uevent(&sbs->charger->dev.kobj, KOBJ_CHANGE);
613+
power_supply_changed(sbs->charger);
614614
}
615615

616616
if (sbs->manager_present) {
@@ -622,7 +622,7 @@ static void acpi_sbs_callback(void *context)
622622
acpi_battery_read(bat);
623623
if (saved_battery_state == bat->present)
624624
continue;
625-
kobject_uevent(&bat->bat->dev.kobj, KOBJ_CHANGE);
625+
power_supply_changed(bat->bat);
626626
}
627627
}
628628
}

0 commit comments

Comments
 (0)