Lines Matching refs:stm

26 	struct stm_device	*stm;  member
102 struct stm_device *stm; in stp_policy_node_masters_store() local
110 stm = policy_node->policy->stm; in stp_policy_node_masters_store()
111 if (!stm) in stp_policy_node_masters_store()
115 if (first > last || first < stm->data->sw_start || in stp_policy_node_masters_store()
116 last > stm->data->sw_end) { in stp_policy_node_masters_store()
149 struct stm_device *stm; in stp_policy_node_channels_store() local
157 stm = policy_node->policy->stm; in stp_policy_node_channels_store()
158 if (!stm) in stp_policy_node_channels_store()
162 last >= stm->data->sw_nchannels) { in stp_policy_node_channels_store()
238 if (!policy->stm) in stp_policy_node_make()
241 pdrv = policy->stm->pdrv; in stp_policy_node_make()
251 if (policy->stm->pdrv_node_type) in stp_policy_node_make()
252 type = policy->stm->pdrv_node_type; in stp_policy_node_make()
259 policy_node->first_master = policy->stm->data->sw_start; in stp_policy_node_make()
260 policy_node->last_master = policy->stm->data->sw_end; in stp_policy_node_make()
262 policy_node->last_channel = policy->stm->data->sw_nchannels - 1; in stp_policy_node_make()
295 (policy && policy->stm) ? in stp_policy_device_show()
296 policy->stm->data->name : in stp_policy_device_show()
311 (policy && policy->stm) ? in stp_policy_protocol_show()
312 policy->stm->pdrv->name : in stp_policy_protocol_show()
328 struct stm_device *stm = policy->stm; in stp_policy_unbind() local
335 if (WARN_ON_ONCE(!policy->stm)) in stp_policy_unbind()
338 lockdep_assert_held(&stm->policy_mutex); in stp_policy_unbind()
340 stm->policy = NULL; in stp_policy_unbind()
341 policy->stm = NULL; in stp_policy_unbind()
346 stm_put_protocol(stm->pdrv); in stp_policy_unbind()
347 stm->pdrv = NULL; in stp_policy_unbind()
348 stm_put_device(stm); in stp_policy_unbind()
354 struct stm_device *stm = policy->stm; in stp_policy_release() local
357 if (!stm) in stp_policy_release()
360 mutex_lock(&stm->policy_mutex); in stp_policy_release()
362 mutex_unlock(&stm->policy_mutex); in stp_policy_release()
389 struct stm_device *stm; in stp_policy_make() local
420 stm = stm_find_device(devname); in stp_policy_make()
421 if (!stm) { in stp_policy_make()
430 stm_put_device(stm); in stp_policy_make()
434 mutex_lock(&stm->policy_mutex); in stp_policy_make()
435 if (stm->policy) { in stp_policy_make()
440 stm->policy = kzalloc(sizeof(*stm->policy), GFP_KERNEL); in stp_policy_make()
441 if (!stm->policy) { in stp_policy_make()
446 config_group_init_type_name(&stm->policy->group, name, in stp_policy_make()
449 stm->pdrv = pdrv; in stp_policy_make()
450 stm->pdrv_node_type = pdrv_node_type; in stp_policy_make()
451 stm->policy->stm = stm; in stp_policy_make()
452 ret = &stm->policy->group; in stp_policy_make()
455 mutex_unlock(&stm->policy_mutex); in stp_policy_make()
463 stm_put_device(stm); in stp_policy_make()
533 stp_policy_node_lookup(struct stm_device *stm, char *s) in stp_policy_node_lookup() argument
539 mutex_lock(&stm->policy_mutex); in stp_policy_node_lookup()
540 if (stm->policy) in stp_policy_node_lookup()
541 policy_node = __stp_policy_node_lookup(stm->policy, s); in stp_policy_node_lookup()
542 mutex_unlock(&stm->policy_mutex); in stp_policy_node_lookup()