mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
power: supply: cw2015: avoid frequent psy change report
Signed-off-by: Chen Shunqing <csq@rock-chips.com> Change-Id: I63bedab66cb7c65a54ba10c1c2fb0970d32a9d31
This commit is contained in:
@@ -411,13 +411,12 @@ static void cw_update_time_to_empty(struct cw_battery *cw_bat)
|
||||
int time_to_empty;
|
||||
|
||||
time_to_empty = cw_get_time_to_empty(cw_bat);
|
||||
if (time_to_empty < 0)
|
||||
if (time_to_empty < 0) {
|
||||
dev_err(cw_bat->dev, "Failed to get time to empty from gauge: %d\n",
|
||||
time_to_empty);
|
||||
else if (cw_bat->time_to_empty != time_to_empty) {
|
||||
cw_bat->time_to_empty = time_to_empty;
|
||||
cw_bat->battery_changed = true;
|
||||
return;
|
||||
}
|
||||
cw_bat->time_to_empty = time_to_empty;
|
||||
}
|
||||
|
||||
static void cw_bat_work(struct work_struct *work)
|
||||
|
||||
Reference in New Issue
Block a user