if (timer) { if (!list_empty(&timer->open_list_head)) { timeri = (snd_timer_instance_t *)list_entry(timer->open_list_head.next, snd_timer_instance_t, open_list); if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) { up(&register_mutex); return -EBUSY; } } timeri = snd_timer_instance_new(owner, timer); if (timeri) { timeri->slave_class = tid->dev_sclass; timeri->slave_id = slave_id; if (list_empty(&timer->open_list_head) && timer->hw.open) timer->hw.open(timer); list_add_tail(&timeri->open_list, &timer->open_list_head); snd_timer_check_master(timeri); } } else { 
if (!timer) { 
int snd_timer_open(snd_timer_instance_t **ti,		   char *owner, snd_timer_id_t *tid,		   unsigned int slave_id){	snd_timer_t *timer;	snd_timer_instance_t *timeri = NULL;		if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) {		/* open a slave instance */		if (tid->dev_sclass <= SNDRV_TIMER_SCLASS_NONE ||		    tid->dev_sclass > SNDRV_TIMER_SCLASS_OSS_SEQUENCER) {			snd_printd("invalid slave class %i\n", tid->dev_sclass);			return -EINVAL;		}		down(&register_mutex);		timeri = snd_timer_instance_new(owner, NULL);		timeri->slave_class = tid->dev_sclass;		timeri->slave_id = tid->device;		timeri->flags |= SNDRV_TIMER_IFLG_SLAVE;		list_add_tail(&timeri->open_list, &snd_timer_slave_list);		snd_timer_check_slave(timeri);		up(&register_mutex);		*ti = timeri;		return 0;	}	/* open a master instance */	down(&register_mutex);	timer = snd_timer_find(tid);#ifdef CONFIG_KMOD	if (timer == NULL) {		up(&register_mutex);		snd_timer_request(tid);		down(&register_mutex);		timer = snd_timer_find(tid);	}#endif	if (timer) {		if (!list_empty(&timer->open_list_head)) {			timeri = (snd_timer_instance_t *)list_entry(timer->open_list_head.next, snd_timer_instance_t, open_list);			if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) {				up(&register_mutex);				return -EBUSY;			}		}		timeri = snd_timer_instance_new(owner, timer);		if (timeri) {			timeri->slave_class = tid->dev_sclass;			timeri->slave_id = slave_id;			if (list_empty(&timer->open_list_head) && timer->hw.open)				timer->hw.open(timer);			list_add_tail(&timeri->open_list, &timer->open_list_head);			snd_timer_check_master(timeri);		}	} else {		up(&register_mutex);		return -ENODEV;	}	up(&register_mutex);	*ti = timeri;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2fd43d1159d22395aae01836c4b13ee5265a9b6b/timer.c/clean/sound/core/timer.c