X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Facpi%2Fbattery.c;h=3026e3fa83efc82923daf64e1f00fd2b59f23848;hb=868c522b1b75fd3fd3e6a636b4c344ac08edf13a;hp=75f39f2c166d88b3b186a0bb2633fac77165753b;hpb=f9b44121b34174ae4f243a568393fc3225842e75;p=karo-tx-linux.git diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 75f39f2c166d..3026e3fa83ef 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef CONFIG_ACPI_PROCFS_POWER #include @@ -567,13 +568,13 @@ static int acpi_battery_update(struct acpi_battery *battery) result = acpi_battery_get_status(battery); if (result) return result; -#ifdef CONFIG_ACPI_SYSFS_POWER if (!acpi_battery_present(battery)) { +#ifdef CONFIG_ACPI_SYSFS_POWER sysfs_remove_battery(battery); +#endif battery->update_time = 0; return 0; } -#endif if (!battery->update_time || old_present != acpi_battery_present(battery)) { result = acpi_battery_get_info(battery); @@ -879,7 +880,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event) #ifdef CONFIG_ACPI_SYSFS_POWER /* acpi_battery_update could remove power_supply object */ if (battery->bat.dev) - kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE); + power_supply_changed(&battery->bat); #endif }