aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-07-26 08:10:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-07-26 08:10:00 -0700
commitdbbe4649d683577de1063dbd9f6da7d4b8de2fed (patch)
tree039ff36f35190cbbf235afdaf90d66d4e78fbd07 /drivers/acpi/battery.c
parent24b1442d01ae155ea716dfb94ed21605541c317d (diff)
parent0e1cf38889110a7188999388614aef17a84d9d25 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: ACPI / Sleep: Allow the NVS saving to be skipped during suspend to RAM ACPI: create "processor.bm_check_disable" boot param ACPI: skip checking BM_STS if the BIOS doesn't ask for it ACPI: fix unused function warning ACPI: processor: fix processor_physically_present on UP ACPI video: fix string mismatch for Sony SR290 laptop ACPI battery: don't invoke power_supply_changed twice when battery is hot-added ACPI: handle systems which asynchoronously enable ACPI mode
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 3026e3fa83e..dc58402b0a1 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -868,9 +868,15 @@ static void acpi_battery_remove_fs(struct acpi_device *device)
static void acpi_battery_notify(struct acpi_device *device, u32 event)
{
struct acpi_battery *battery = acpi_driver_data(device);
+#ifdef CONFIG_ACPI_SYSFS_POWER
+ struct device *old;
+#endif
if (!battery)
return;
+#ifdef CONFIG_ACPI_SYSFS_POWER
+ old = battery->bat.dev;
+#endif
acpi_battery_update(battery);
acpi_bus_generate_proc_event(device, event,
acpi_battery_present(battery));
@@ -879,7 +885,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
acpi_battery_present(battery));
#ifdef CONFIG_ACPI_SYSFS_POWER
/* acpi_battery_update could remove power_supply object */
- if (battery->bat.dev)
+ if (old && battery->bat.dev)
power_supply_changed(&battery->bat);
#endif
}