ACPI: battery: Call power_supply_changed() when adding hooks
authorArmin Wolf <W_Armin@gmx.de>
Wed, 30 Nov 2022 18:41:01 +0000 (19:41 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Dec 2022 19:29:19 +0000 (20:29 +0100)
commit98b0cf207b61e17f3ea6d9c17334c8ffc2f44863
treea52d171c8278569c7fc429f9d5348241783671c0
parentb7b275e60bcd5f89771e865a8239325f86d9927d
ACPI: battery: Call power_supply_changed() when adding hooks

If a battery hook is added to a battery, userspace software
is not informed that the available properties of the battery
might have changed. This for example causes upower to react
slowly if a new battery hook is added during runtime.

Fix this by calling power_supply_changed() if a battery hook
was successfully added/removed.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c