bq27x00_battery: Call power_supply_changed only when capacity changed
[sfrench/cifs-2.6.git] / drivers / power / bq27x00_battery.c
index baae2151cb9a72e4b3fcb97a9e43b8e08a560920..b72ba7c1bd69fd99365381414ca84305d5b20808 100644 (file)
@@ -497,10 +497,11 @@ static void bq27x00_update(struct bq27x00_device_info *di)
                        di->charge_design_full = bq27x00_battery_read_ilmd(di);
        }
 
-       if (memcmp(&di->cache, &cache, sizeof(cache)) != 0) {
-               di->cache = cache;
+       if (di->cache.capacity != cache.capacity)
                power_supply_changed(&di->bat);
-       }
+
+       if (memcmp(&di->cache, &cache, sizeof(cache)) != 0)
+               di->cache = cache;
 
        di->last_update = jiffies;
 }