Lines Matching refs:sr
279 struct wf_sensor *sr = container_of(kref, struct wf_sensor, ref); in wf_sensor_release() local
281 DBG("wf: Deleting sensor %s\n", sr->name); in wf_sensor_release()
283 if (sr->ops && sr->ops->release) in wf_sensor_release()
284 sr->ops->release(sr); in wf_sensor_release()
286 kfree(sr); in wf_sensor_release()
304 struct wf_sensor *sr; in wf_register_sensor() local
307 list_for_each_entry(sr, &wf_sensors, link) { in wf_register_sensor()
308 if (!strcmp(sr->name, new_sr->name)) { in wf_register_sensor()
310 " duplicate sensor %s\n", sr->name); in wf_register_sensor()
337 void wf_unregister_sensor(struct wf_sensor *sr) in wf_unregister_sensor() argument
340 list_del(&sr->link); in wf_unregister_sensor()
343 DBG("wf: Unregistered sensor %s\n", sr->name); in wf_unregister_sensor()
345 wf_put_sensor(sr); in wf_unregister_sensor()
349 int wf_get_sensor(struct wf_sensor *sr) in wf_get_sensor() argument
351 if (!try_module_get(sr->ops->owner)) in wf_get_sensor()
353 kref_get(&sr->ref); in wf_get_sensor()
358 void wf_put_sensor(struct wf_sensor *sr) in wf_put_sensor() argument
360 struct module *mod = sr->ops->owner; in wf_put_sensor()
361 kref_put(&sr->ref, wf_sensor_release); in wf_put_sensor()
375 struct wf_sensor *sr; in wf_register_client() local
384 list_for_each_entry(sr, &wf_sensors, link) in wf_register_client()
385 wf_notify(WF_EVENT_NEW_SENSOR, sr); in wf_register_client()