lkml.org 
[lkml]   [2011]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 9/9] bq27x00: Fix OOPS caused by unregistring bq27x00 driver
Date
* power_supply_unregister call bq27x00_battery_get_property which call bq27x00_battery_poll
* make sure that bq27x00_battery_poll will not call schedule_delayed_work again after unregister (which cause OOPS)

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/power/bq27x00_battery.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index 15ecd42..29ce907 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -722,6 +722,10 @@ static int bq27x00_powersupply_init(struct bq27x00_device_info *di)

static void bq27x00_powersupply_unregister(struct bq27x00_device_info *di)
{
+ /* power_supply_unregister call bq27x00_battery_get_property which call bq27x00_battery_poll */
+ /* make sure that bq27x00_battery_poll will not call schedule_delayed_work again after unregister (which cause OOPS) */
+ poll_interval = 0;
+
cancel_delayed_work_sync(&di->work);

bq27x00_battery_reg_exit(di);
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-11-01 01:51    [W:0.197 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site