Lines Matching refs:cbq
39 struct cn_callback_entry *cbq; in cn_queue_alloc_callback_entry() local
41 cbq = kzalloc(sizeof(*cbq), GFP_KERNEL); in cn_queue_alloc_callback_entry()
42 if (!cbq) { in cn_queue_alloc_callback_entry()
47 atomic_set(&cbq->refcnt, 1); in cn_queue_alloc_callback_entry()
50 cbq->pdev = dev; in cn_queue_alloc_callback_entry()
52 snprintf(cbq->id.name, sizeof(cbq->id.name), "%s", name); in cn_queue_alloc_callback_entry()
53 memcpy(&cbq->id.id, id, sizeof(struct cb_id)); in cn_queue_alloc_callback_entry()
54 cbq->callback = callback; in cn_queue_alloc_callback_entry()
55 return cbq; in cn_queue_alloc_callback_entry()
58 void cn_queue_release_callback(struct cn_callback_entry *cbq) in cn_queue_release_callback() argument
60 if (!atomic_dec_and_test(&cbq->refcnt)) in cn_queue_release_callback()
63 atomic_dec(&cbq->pdev->refcnt); in cn_queue_release_callback()
64 kfree(cbq); in cn_queue_release_callback()
76 struct cn_callback_entry *cbq, *__cbq; in cn_queue_add_callback() local
79 cbq = cn_queue_alloc_callback_entry(dev, name, id, callback); in cn_queue_add_callback()
80 if (!cbq) in cn_queue_add_callback()
91 list_add_tail(&cbq->callback_entry, &dev->queue_list); in cn_queue_add_callback()
95 cn_queue_release_callback(cbq); in cn_queue_add_callback()
99 cbq->seq = 0; in cn_queue_add_callback()
100 cbq->group = cbq->id.id.idx; in cn_queue_add_callback()
107 struct cn_callback_entry *cbq, *n; in cn_queue_del_callback() local
111 list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry) { in cn_queue_del_callback()
112 if (cn_cb_equal(&cbq->id.id, id)) { in cn_queue_del_callback()
113 list_del(&cbq->callback_entry); in cn_queue_del_callback()
121 cn_queue_release_callback(cbq); in cn_queue_del_callback()
144 struct cn_callback_entry *cbq, *n; in cn_queue_free_dev() local
147 list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry) in cn_queue_free_dev()
148 list_del(&cbq->callback_entry); in cn_queue_free_dev()