diff options
author | Michael Trimarchi <trimarchi@gandalf.sssup.it> | 2009-05-23 17:54:00 -0300 |
---|---|---|
committer | Nelson Castillo <arhuaco@freaks-unidos.net> | 2009-06-01 20:38:19 -0300 |
commit | 5b8138ba5c1dbc86dce264a0d4c078737aa2007a (patch) | |
tree | bc44957ce570030a64f0d03cbfff13515e289e83 | |
parent | 44bf2b8856db1f5079a1a531f70bbd25cf4ed488 (diff) |
Improve battery status notification
This patch adds a call to cancel_delayed_work before a call
to schedule_delayed_work.
Signed-off-by: Michael Trimarchi <michael@panicking.kicks-ass.org>
Signed-off-by: Daniel Willmann <daniel@totalueberwachung.de>
-rw-r--r-- | drivers/power/bq27000_battery.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c index 9f0f1a96720..7e8b3f8ad96 100644 --- a/drivers/power/bq27000_battery.c +++ b/drivers/power/bq27000_battery.c @@ -170,9 +170,11 @@ static int hdq_read16(struct bq27000_device_info *di, int address) static void bq27000_battery_external_power_changed(struct power_supply *psy) { - struct bq27000_device_info *di = container_of(psy, struct bq27000_device_info, bat); + struct bq27000_device_info *di = + container_of(psy, struct bq27000_device_info, bat); dev_dbg(di->dev, "%s\n", __FUNCTION__); + cancel_delayed_work(&di->work); schedule_delayed_work(&di->work, 0); } |