linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 05/22] lp8727_charger: remove unnecessary workqueue thread
@ 2012-08-31  9:23 Kim, Milo
  0 siblings, 0 replies; only message in thread
From: Kim, Milo @ 2012-08-31  9:23 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: David Woodhouse, linux-kernel

 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>
---
 drivers/power/lp8727_charger.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index 1907b1f..c33532b 100644
--- a/drivers/power/lp8727_charger.c
+++ b/drivers/power/lp8727_charger.c
@@ -85,7 +85,6 @@ struct lp8727_chg {
 	struct i2c_client *client;
 	struct mutex xfer_lock;
 	struct delayed_work work;
-	struct workqueue_struct *irqthread;
 	struct lp8727_platform_data *pdata;
 	struct lp8727_psy *psy;
 	struct lp8727_chg_param *chg_parm;
@@ -238,9 +237,7 @@ static irqreturn_t lp8727_isr_func(int irq, void *ptr)
 {
 	struct lp8727_chg *pchg = ptr;
 
-	queue_delayed_work(pchg->irqthread, &pchg->work,
-					pchg->debounce_jiffies);
-
+	schedule_delayed_work(&pchg->work, pchg->debounce_jiffies);
 	return IRQ_HANDLED;
 }
 
@@ -251,12 +248,6 @@ static int lp8727_intr_config(struct lp8727_chg *pchg)
 
 	INIT_DELAYED_WORK(&pchg->work, lp8727_delayed_func);
 
-	pchg->irqthread = create_singlethread_workqueue("lp8727-irqthd");
-	if (!pchg->irqthread) {
-		dev_err(pchg->dev, "can not create thread for lp8727\n");
-		return -ENOMEM;
-	}
-
 	pchg->debounce_jiffies = msecs_to_jiffies(delay_msec);
 
 	return request_threaded_irq(pchg->client->irq,
@@ -486,8 +477,6 @@ static int __devexit lp8727_remove(struct i2c_client *cl)
 	struct lp8727_chg *pchg = i2c_get_clientdata(cl);
 
 	free_irq(pchg->client->irq, pchg);
-	flush_workqueue(pchg->irqthread);
-	destroy_workqueue(pchg->irqthread);
 	lp8727_unregister_psy(pchg);
 	return 0;
 }
-- 
1.7.9.5


Best Regards,
Milo



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-31  9:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31  9:23 [PATCH 05/22] lp8727_charger: remove unnecessary workqueue thread Kim, Milo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).