diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-08-31 05:23:41 -0400 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-09-20 20:57:49 -0400 |
commit | 2a0925827be53db6252afadc79c657b14638ff4a (patch) | |
tree | 0564be968102b0df02cf09785bac21d738f90d57 /drivers/power | |
parent | 60fd57e06ed7ea13bc0bdf4cb5324d47039105ab (diff) |
lp8727_charger: Remove unnecessary workqueue thread
LP8727 has two IRQ threads. One is the I2C HW IRQ pin, the other is for
delayed interrupt processing. But this delayed processing can be handled
without additional single thread by using schedule_delayed_work() with
jiffies time value.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/lp8727_charger.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 1907b1f7953d..c33532bbb9c7 100644 --- a/drivers/power/lp8727_charger.c +++ b/drivers/power/lp8727_charger.c | |||
@@ -85,7 +85,6 @@ struct lp8727_chg { | |||
85 | struct i2c_client *client; | 85 | struct i2c_client *client; |
86 | struct mutex xfer_lock; | 86 | struct mutex xfer_lock; |
87 | struct delayed_work work; | 87 | struct delayed_work work; |
88 | struct workqueue_struct *irqthread; | ||
89 | struct lp8727_platform_data *pdata; | 88 | struct lp8727_platform_data *pdata; |
90 | struct lp8727_psy *psy; | 89 | struct lp8727_psy *psy; |
91 | struct lp8727_chg_param *chg_parm; | 90 | struct lp8727_chg_param *chg_parm; |
@@ -238,9 +237,7 @@ static irqreturn_t lp8727_isr_func(int irq, void *ptr) | |||
238 | { | 237 | { |
239 | struct lp8727_chg *pchg = ptr; | 238 | struct lp8727_chg *pchg = ptr; |
240 | 239 | ||
241 | queue_delayed_work(pchg->irqthread, &pchg->work, | 240 | schedule_delayed_work(&pchg->work, pchg->debounce_jiffies); |
242 | pchg->debounce_jiffies); | ||
243 | |||
244 | return IRQ_HANDLED; | 241 | return IRQ_HANDLED; |
245 | } | 242 | } |
246 | 243 | ||
@@ -251,12 +248,6 @@ static int lp8727_intr_config(struct lp8727_chg *pchg) | |||
251 | 248 | ||
252 | INIT_DELAYED_WORK(&pchg->work, lp8727_delayed_func); | 249 | INIT_DELAYED_WORK(&pchg->work, lp8727_delayed_func); |
253 | 250 | ||
254 | pchg->irqthread = create_singlethread_workqueue("lp8727-irqthd"); | ||
255 | if (!pchg->irqthread) { | ||
256 | dev_err(pchg->dev, "can not create thread for lp8727\n"); | ||
257 | return -ENOMEM; | ||
258 | } | ||
259 | |||
260 | pchg->debounce_jiffies = msecs_to_jiffies(delay_msec); | 251 | pchg->debounce_jiffies = msecs_to_jiffies(delay_msec); |
261 | 252 | ||
262 | return request_threaded_irq(pchg->client->irq, | 253 | return request_threaded_irq(pchg->client->irq, |
@@ -486,8 +477,6 @@ static int __devexit lp8727_remove(struct i2c_client *cl) | |||
486 | struct lp8727_chg *pchg = i2c_get_clientdata(cl); | 477 | struct lp8727_chg *pchg = i2c_get_clientdata(cl); |
487 | 478 | ||
488 | free_irq(pchg->client->irq, pchg); | 479 | free_irq(pchg->client->irq, pchg); |
489 | flush_workqueue(pchg->irqthread); | ||
490 | destroy_workqueue(pchg->irqthread); | ||
491 | lp8727_unregister_psy(pchg); | 480 | lp8727_unregister_psy(pchg); |
492 | return 0; | 481 | return 0; |
493 | } | 482 | } |