diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-07-13 09:42:45 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-07-13 09:42:45 +0000 |
commit | d6035ac6ad1c10d867c57cd53e074fa521a537b0 (patch) | |
tree | 9af22ba8a433532636b3d6c7936f26fbed9ddab1 /drivers/dahdi/xpp/card_global.c | |
parent | 330259c92d09fba56efca9d5be4cd2b237645725 (diff) |
put xbus->worker in xbus; wake_up_interruptible_all()
* The worker member of 'struct xbus' is now an embedded struct xbus_workqueue.
* Replace wake_up() to wake_up_interruptible_all().
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8882 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/card_global.c')
-rw-r--r-- | drivers/dahdi/xpp/card_global.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c index f8f79b2..2428cbe 100644 --- a/drivers/dahdi/xpp/card_global.c +++ b/drivers/dahdi/xpp/card_global.c @@ -576,13 +576,17 @@ HANDLER_DEF(GLOBAL, NULL_REPLY) HANDLER_DEF(GLOBAL, AB_DESCRIPTION) /* 0x08 */ { - struct xbus_workqueue *worker = xbus->worker; + struct xbus_workqueue *worker; byte rev; struct unit_descriptor *units; int count_units; int i; int ret = 0; + if (!xbus) { + NOTICE("%s: xbus is gone!!!\n", __func__); + goto out; + } rev = RPACKET_FIELD(pack, GLOBAL, AB_DESCRIPTION, rev); units = RPACKET_FIELD(pack, GLOBAL, AB_DESCRIPTION, unit_descriptor); count_units = XPACKET_LEN(pack) - ((byte *)units - (byte *)pack); @@ -611,10 +615,11 @@ HANDLER_DEF(GLOBAL, AB_DESCRIPTION) /* 0x08 */ } XBUS_INFO(xbus, "DESCRIPTOR: %d cards, protocol revision %d\n", count_units, rev); xbus->revision = rev; - if(!worker) { - XBUS_ERR(xbus, "missing worker\n"); + worker = &xbus->worker; + if (!worker->wq) { + XBUS_ERR(xbus, "missing worker thread\n"); ret = -ENODEV; - goto err; + goto out; } for(i = 0; i < count_units; i++) { struct unit_descriptor *this_unit = &units[i]; @@ -624,7 +629,7 @@ HANDLER_DEF(GLOBAL, AB_DESCRIPTION) /* 0x08 */ if((card_desc = KZALLOC(sizeof(struct card_desc_struct), GFP_ATOMIC)) == NULL) { XBUS_ERR(xbus, "Card description allocation failed.\n"); ret = -ENOMEM; - goto err; + goto out; } card_desc->magic = CARD_DESC_MAGIC; INIT_LIST_HEAD(&card_desc->card_list); @@ -650,12 +655,14 @@ HANDLER_DEF(GLOBAL, AB_DESCRIPTION) /* 0x08 */ list_add_tail(&card_desc->card_list, &worker->card_list); spin_unlock_irqrestore(&worker->worker_lock, flags); } - if(!xbus_process_worker(xbus)) - return -ENODEV; - return 0; + if (!xbus_process_worker(xbus)) { + ret = -ENODEV; + goto out; + } + goto out; proto_err: dump_packet("AB_DESCRIPTION", pack, DBG_ANY); -err: +out: return ret; } |