Lines Matching refs:ct
153 struct wf_control *ct = container_of(kref, struct wf_control, ref); in wf_control_release() local
155 DBG("wf: Deleting control %s\n", ct->name); in wf_control_release()
157 if (ct->ops && ct->ops->release) in wf_control_release()
158 ct->ops->release(ct); in wf_control_release()
160 kfree(ct); in wf_control_release()
213 struct wf_control *ct; in wf_register_control() local
216 list_for_each_entry(ct, &wf_controls, link) { in wf_register_control()
217 if (!strcmp(ct->name, new_ct->name)) { in wf_register_control()
219 " duplicate control %s\n", ct->name); in wf_register_control()
246 void wf_unregister_control(struct wf_control *ct) in wf_unregister_control() argument
249 list_del(&ct->link); in wf_unregister_control()
252 DBG("wf: Unregistered control %s\n", ct->name); in wf_unregister_control()
254 kref_put(&ct->ref, wf_control_release); in wf_unregister_control()
260 struct wf_control *ct; in wf_find_control() local
263 list_for_each_entry(ct, &wf_controls, link) { in wf_find_control()
264 if (!strcmp(ct->name, name)) { in wf_find_control()
265 if (wf_get_control(ct)) in wf_find_control()
266 ct = NULL; in wf_find_control()
268 return ct; in wf_find_control()
276 int wf_get_control(struct wf_control *ct) in wf_get_control() argument
278 if (!try_module_get(ct->ops->owner)) in wf_get_control()
280 kref_get(&ct->ref); in wf_get_control()
285 void wf_put_control(struct wf_control *ct) in wf_put_control() argument
287 struct module *mod = ct->ops->owner; in wf_put_control()
288 kref_put(&ct->ref, wf_control_release); in wf_put_control()
414 struct wf_control *ct; in wf_register_client() local
422 list_for_each_entry(ct, &wf_controls, link) in wf_register_client()
423 wf_notify(WF_EVENT_NEW_CONTROL, ct); in wf_register_client()