Re: [PATCH] acpi: Update battery information on notification 0x81

Matthew Garrett
2011-01-03T17:59:22Z

On Thu, Dec 23, 2010 at 11:23:42PM +0100, Rafael J. Wysocki wrote:

> As I've already said on IRC, I'd simply add a new function like:
>
> void acpi_battery_refresh(struct acpi_battery *battery)
> {
> if (!battery->bat.dev)
> return;
> acpi_battery_get_info(battery);
> /* The battery may have changed its reporting units */
> sysfs_remove_battery(battery);
> sysfs_add_battery(battery);
> }
>
> and call it before acpi_battery_update()
> (a) in acpi_battery_resume()
> (b) in acpi_battery_notify() if event == ACPI_BATTERY_NOTIFY_INFO
>
> That would be more straightforward IMHO.

That might be more reasonable. Want to send that, or shall I?

--
Matthew Garrett | mjg59@srcf.ucam.org