summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-25 18:31:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-25 18:31:00 +0200
commitbcc66c0b8881f88459f9ac21038455bcafacdc6e (patch)
treeb402e677253c3fc1038ca4a52fc54fc223261133 /drivers/acpi/battery.c
parentstaging: r8712u: Remove useless driver version info (diff)
parentLinux 3.5-rc4 (diff)
downloadlinux-bcc66c0b8881f88459f9ac21038455bcafacdc6e.tar.xz
linux-bcc66c0b8881f88459f9ac21038455bcafacdc6e.zip
Merge 3.5-rc4 into staging-next
This picks up the staging changes made in 3.5-rc4 so that everyone can sync up properly. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 86933ca8b472..7dd3f9fb9f3f 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -643,11 +643,19 @@ static int acpi_battery_update(struct acpi_battery *battery)
static void acpi_battery_refresh(struct acpi_battery *battery)
{
+ int power_unit;
+
if (!battery->bat.dev)
return;
+ power_unit = battery->power_unit;
+
acpi_battery_get_info(battery);
- /* The battery may have changed its reporting units. */
+
+ if (power_unit == battery->power_unit)
+ return;
+
+ /* The battery has changed its reporting units. */
sysfs_remove_battery(battery);
sysfs_add_battery(battery);
}