diff options
Diffstat (limited to 'drivers/acpi/battery.c')
| -rw-r--r-- | drivers/acpi/battery.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 @@ | |||
| 32 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
| 33 | #include <linux/async.h> | 33 | #include <linux/async.h> |
| 34 | #include <linux/dmi.h> | 34 | #include <linux/dmi.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | 36 | ||
| 36 | #ifdef CONFIG_ACPI_PROCFS_POWER | 37 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 37 | #include <linux/proc_fs.h> | 38 | #include <linux/proc_fs.h> |
| @@ -567,13 +568,13 @@ static int acpi_battery_update(struct acpi_battery *battery) | |||
| 567 | result = acpi_battery_get_status(battery); | 568 | result = acpi_battery_get_status(battery); |
| 568 | if (result) | 569 | if (result) |
| 569 | return result; | 570 | return result; |
| 570 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
| 571 | if (!acpi_battery_present(battery)) { | 571 | if (!acpi_battery_present(battery)) { |
| 572 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
| 572 | sysfs_remove_battery(battery); | 573 | sysfs_remove_battery(battery); |
| 574 | #endif | ||
| 573 | battery->update_time = 0; | 575 | battery->update_time = 0; |
| 574 | return 0; | 576 | return 0; |
| 575 | } | 577 | } |
| 576 | #endif | ||
| 577 | if (!battery->update_time || | 578 | if (!battery->update_time || |
| 578 | old_present != acpi_battery_present(battery)) { | 579 | old_present != acpi_battery_present(battery)) { |
| 579 | result = acpi_battery_get_info(battery); | 580 | result = acpi_battery_get_info(battery); |
| @@ -879,7 +880,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event) | |||
| 879 | #ifdef CONFIG_ACPI_SYSFS_POWER | 880 | #ifdef CONFIG_ACPI_SYSFS_POWER |
| 880 | /* acpi_battery_update could remove power_supply object */ | 881 | /* acpi_battery_update could remove power_supply object */ |
| 881 | if (battery->bat.dev) | 882 | if (battery->bat.dev) |
| 882 | kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE); | 883 | power_supply_changed(&battery->bat); |
| 883 | #endif | 884 | #endif |
| 884 | } | 885 | } |
| 885 | 886 | ||
