summaryrefslogtreecommitdiff
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-06 21:47:15 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-06 21:47:15 +0400
commitff39d0e8f08f8b5a51352652a2d46c51bb7b6ecd (patch)
treea5dd7023ec15916604575efbd70b1aa94ab5bf53 /drivers/acpi/battery.c
parentae501be0f631bd4fb751c5f580e396f59b2011f1 (diff)
parentd3514abcf5b896a3a66d8b7c960a0018a52ebc2c (diff)
downloadlinux-ff39d0e8f08f8b5a51352652a2d46c51bb7b6ecd.tar.xz
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull ACPI and Power Management changes from Len Brown. This does an evil merge to fix up what I think is a mismerge by Len to the gma500 driver, and restore it to the mainline state. In that driver, both branches had commented out the call to acpi_video_register(), and Len resolved the merge to that commented-out version. However, in mainline, further changes by Alan (commit d839ede47a56: "gma500: opregion and ACPI" to be exact) had re-enabled the ACPI video registration, so the current state of the driver seems to want it. Alan is apparently still feeling the effects of partying with the Queen, so he didn't reply to my query, but I'll do the evil merge anyway. * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: ACPI: fix acpi_bus.h build warnings when ACPI is not enabled drivers: acpi: Fix dependency for ACPI_HOTPLUG_CPU tools/power turbostat: fix IVB support tools/power turbostat: fix un-intended affinity of forked program ACPI video: use after input_unregister_device() gma500: don't register the ACPI video bus acpi_video: Intel video is not always i915 acpi_video: fix leaking PCI references ACPI: Ignore invalid _PSS entries, but use valid ones ACPI battery: only refresh the sysfs files when pertinent information changes
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);
}