summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2010-07-22 18:18:05 -0400
committerLen Brown <len.brown@intel.com>2010-07-22 18:18:05 -0400
commit27568d8e5f7a038795dff997a906f775084f927a (patch)
treecb414c92905234bfc29d21a52e076a97ceb88651 /drivers/acpi
parent855977ef6d07e8d1d50994ab7310e40d18a64e16 (diff)
parent153e500f516329f439856f52ccbf61d1fd1a946a (diff)
downloadop-kernel-dev-27568d8e5f7a038795dff997a906f775084f927a.zip
op-kernel-dev-27568d8e5f7a038795dff997a906f775084f927a.tar.gz
Merge branch 'bugzilla-16244' into release
Diffstat (limited to 'drivers/acpi')
-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 3026e3f..dc58402 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
}
OpenPOWER on IntegriCloud