diff options
author | David Howells <dhowells@redhat.com> | 2006-11-22 09:57:56 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2006-11-22 09:57:56 -0500 |
commit | c4028958b6ecad064b1a6303a6a5906d4fe48d73 (patch) | |
tree | 1c4c89652c62a75da09f9b9442012007e4ac6250 /drivers/connector/connector.c | |
parent | 65f27f38446e1976cc98fd3004b110fedcddd189 (diff) |
WorkStruct: make allyesconfig
Fix up for make allyesconfig.
Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/connector/connector.c')
-rw-r--r-- | drivers/connector/connector.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index b49bacfd8de8..5e7cd45d10ee 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -135,40 +135,39 @@ 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(!test_bit(0, &__cbq->work.pending) && | 138 | if (likely(!test_bit(WORK_STRUCT_PENDING, |
139 | &__cbq->work.work.management) && | ||
139 | __cbq->data.ddata == NULL)) { | 140 | __cbq->data.ddata == NULL)) { |
140 | __cbq->data.callback_priv = msg; | 141 | __cbq->data.callback_priv = msg; |
141 | 142 | ||
142 | __cbq->data.ddata = data; | 143 | __cbq->data.ddata = data; |
143 | __cbq->data.destruct_data = destruct_data; | 144 | __cbq->data.destruct_data = destruct_data; |
144 | 145 | ||
145 | if (queue_work(dev->cbdev->cn_queue, | 146 | if (queue_delayed_work( |
146 | &__cbq->work)) | 147 | dev->cbdev->cn_queue, |
148 | &__cbq->work, 0)) | ||
147 | err = 0; | 149 | err = 0; |
148 | } else { | 150 | } else { |
149 | struct work_struct *w; | ||
150 | struct cn_callback_data *d; | 151 | struct cn_callback_data *d; |
151 | 152 | ||
152 | w = kzalloc(sizeof(*w) + sizeof(*d), GFP_ATOMIC); | 153 | __cbq = kzalloc(sizeof(*__cbq), GFP_ATOMIC); |
153 | if (w) { | 154 | if (__cbq) { |
154 | d = (struct cn_callback_data *)(w+1); | 155 | d = &__cbq->data; |
155 | |||
156 | d->callback_priv = msg; | 156 | d->callback_priv = msg; |
157 | d->callback = __cbq->data.callback; | 157 | d->callback = __cbq->data.callback; |
158 | d->ddata = data; | 158 | d->ddata = data; |
159 | d->destruct_data = destruct_data; | 159 | d->destruct_data = destruct_data; |
160 | d->free = w; | 160 | d->free = __cbq; |
161 | 161 | ||
162 | INIT_LIST_HEAD(&w->entry); | 162 | INIT_DELAYED_WORK(&__cbq->work, |
163 | w->pending = 0; | 163 | &cn_queue_wrapper); |
164 | w->func = &cn_queue_wrapper; | ||
165 | w->data = d; | ||
166 | init_timer(&w->timer); | ||
167 | 164 | ||
168 | if (queue_work(dev->cbdev->cn_queue, w)) | 165 | if (queue_delayed_work( |
166 | dev->cbdev->cn_queue, | ||
167 | &__cbq->work, 0)) | ||
169 | err = 0; | 168 | err = 0; |
170 | else { | 169 | else { |
171 | kfree(w); | 170 | kfree(__cbq); |
172 | err = -EINVAL; | 171 | err = -EINVAL; |
173 | } | 172 | } |
174 | } else | 173 | } else |