Lines Matching refs:cbq
26 struct cn_callback_entry *cbq; in cn_queue_alloc_callback_entry() local
28 cbq = kzalloc(sizeof(*cbq), GFP_KERNEL); in cn_queue_alloc_callback_entry()
29 if (!cbq) { in cn_queue_alloc_callback_entry()
34 refcount_set(&cbq->refcnt, 1); in cn_queue_alloc_callback_entry()
37 cbq->pdev = dev; in cn_queue_alloc_callback_entry()
39 snprintf(cbq->id.name, sizeof(cbq->id.name), "%s", name); in cn_queue_alloc_callback_entry()
40 memcpy(&cbq->id.id, id, sizeof(struct cb_id)); in cn_queue_alloc_callback_entry()
41 cbq->callback = callback; in cn_queue_alloc_callback_entry()
42 return cbq; in cn_queue_alloc_callback_entry()
45 void cn_queue_release_callback(struct cn_callback_entry *cbq) in cn_queue_release_callback() argument
47 if (!refcount_dec_and_test(&cbq->refcnt)) in cn_queue_release_callback()
50 atomic_dec(&cbq->pdev->refcnt); in cn_queue_release_callback()
51 kfree(cbq); in cn_queue_release_callback()
64 struct cn_callback_entry *cbq, *__cbq; in cn_queue_add_callback() local
67 cbq = cn_queue_alloc_callback_entry(dev, name, id, callback); in cn_queue_add_callback()
68 if (!cbq) in cn_queue_add_callback()
79 list_add_tail(&cbq->callback_entry, &dev->queue_list); in cn_queue_add_callback()
83 cn_queue_release_callback(cbq); in cn_queue_add_callback()
87 cbq->seq = 0; in cn_queue_add_callback()
88 cbq->group = cbq->id.id.idx; in cn_queue_add_callback()
95 struct cn_callback_entry *cbq, *n; in cn_queue_del_callback() local
99 list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry) { in cn_queue_del_callback()
100 if (cn_cb_equal(&cbq->id.id, id)) { in cn_queue_del_callback()
101 list_del(&cbq->callback_entry); in cn_queue_del_callback()
109 cn_queue_release_callback(cbq); in cn_queue_del_callback()
132 struct cn_callback_entry *cbq, *n; in cn_queue_free_dev() local
135 list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry) in cn_queue_free_dev()
136 list_del(&cbq->callback_entry); in cn_queue_free_dev()