aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2006-12-18 04:53:58 -0500
committerDavid S. Miller <davem@davemloft.net>2006-12-18 04:53:58 -0500
commita240d9f1d8e6421cb970632b93e71b2f66c2cd70 (patch)
treee3d103d3c3637c074d0a2bf48fbcb07dce04b70a /drivers
parent14fb8a764786e37ac26a2175638115f21980e5a3 (diff)
[CONNECTOR]: Replace delayed work with usual work queue.
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/connector/cn_queue.c5
-rw-r--r--drivers/connector/connector.c16
2 files changed, 9 insertions, 12 deletions
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index b418b16e910e..296f51002b55 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -34,7 +34,7 @@
34void cn_queue_wrapper(struct work_struct *work) 34void cn_queue_wrapper(struct work_struct *work)
35{ 35{
36 struct cn_callback_entry *cbq = 36 struct cn_callback_entry *cbq =
37 container_of(work, struct cn_callback_entry, work.work); 37 container_of(work, struct cn_callback_entry, work);
38 struct cn_callback_data *d = &cbq->data; 38 struct cn_callback_data *d = &cbq->data;
39 39
40 d->callback(d->callback_priv); 40 d->callback(d->callback_priv);
@@ -59,13 +59,12 @@ static struct cn_callback_entry *cn_queue_alloc_callback_entry(char *name, struc
59 memcpy(&cbq->id.id, id, sizeof(struct cb_id)); 59 memcpy(&cbq->id.id, id, sizeof(struct cb_id));
60 cbq->data.callback = callback; 60 cbq->data.callback = callback;
61 61
62 INIT_DELAYED_WORK(&cbq->work, &cn_queue_wrapper); 62 INIT_WORK(&cbq->work, &cn_queue_wrapper);
63 return cbq; 63 return cbq;
64} 64}
65 65
66static void cn_queue_free_callback(struct cn_callback_entry *cbq) 66static void cn_queue_free_callback(struct cn_callback_entry *cbq)
67{ 67{
68 cancel_delayed_work(&cbq->work);
69 flush_workqueue(cbq->pdev->cn_queue); 68 flush_workqueue(cbq->pdev->cn_queue);
70 69
71 kfree(cbq); 70 kfree(cbq);
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 4cec1a82fd43..a44db75bc25b 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -135,16 +135,15 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
135 spin_lock_bh(&dev->cbdev->queue_lock); 135 spin_lock_bh(&dev->cbdev->queue_lock);
136 list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) { 136 list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) {
137 if (cn_cb_equal(&__cbq->id.id, &msg->id)) { 137 if (cn_cb_equal(&__cbq->id.id, &msg->id)) {
138 if (likely(!work_pending(&__cbq->work.work) && 138 if (likely(!work_pending(&__cbq->work) &&
139 __cbq->data.ddata == NULL)) { 139 __cbq->data.ddata == NULL)) {
140 __cbq->data.callback_priv = msg; 140 __cbq->data.callback_priv = msg;
141 141
142 __cbq->data.ddata = data; 142 __cbq->data.ddata = data;
143 __cbq->data.destruct_data = destruct_data; 143 __cbq->data.destruct_data = destruct_data;
144 144
145 if (queue_delayed_work( 145 if (queue_work(dev->cbdev->cn_queue,
146 dev->cbdev->cn_queue, 146 &__cbq->work))
147 &__cbq->work, 0))
148 err = 0; 147 err = 0;
149 } else { 148 } else {
150 struct cn_callback_data *d; 149 struct cn_callback_data *d;
@@ -158,12 +157,11 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
158 d->destruct_data = destruct_data; 157 d->destruct_data = destruct_data;
159 d->free = __cbq; 158 d->free = __cbq;
160 159
161 INIT_DELAYED_WORK(&__cbq->work, 160 INIT_WORK(&__cbq->work,
162 &cn_queue_wrapper); 161 &cn_queue_wrapper);
163 162
164 if (queue_delayed_work( 163 if (queue_work(dev->cbdev->cn_queue,
165 dev->cbdev->cn_queue, 164 &__cbq->work))
166 &__cbq->work, 0))
167 err = 0; 165 err = 0;
168 else { 166 else {
169 kfree(__cbq); 167 kfree(__cbq);