void pvr2_channel_done(struct pvr2_channel *cp)
{
	struct pvr2_context *mp = cp->mc_head;
	pvr2_channel_disclaim_stream(cp);
	if (cp->mc_next) {
		cp->mc_next->mc_prev = cp->mc_prev;
	} else {
		mp->mc_last = cp->mc_prev;
	}
	if (cp->mc_prev) {
		cp->mc_prev->mc_next = cp->mc_next;
	} else {
		mp->mc_first = cp->mc_next;
	}
	cp->hdw = NULL;
}
int pvr2_channel_claim_stream(struct pvr2_channel *cp,
			      struct pvr2_context_stream *sp)
{
	int code = 0;
	pvr2_context_enter(cp->mc_head); do {
		if (sp == cp->stream) break;
		if (sp->user) {
			code = -EBUSY;
			break;
		}
		pvr2_channel_disclaim_stream(cp);
		if (!sp) break;
		sp->user = cp;
		cp->stream = sp;
	} while (0); pvr2_context_exit(cp->mc_head);
	return code;
}
예제 #3
0
void pvr2_channel_done(struct pvr2_channel *cp)
{
    struct pvr2_context *mp = cp->mc_head;
    pvr2_context_enter(mp);
    cp->input_mask = 0;
    pvr2_channel_disclaim_stream(cp);
    pvr2_context_reset_input_limits(mp);
    if (cp->mc_next) {
        cp->mc_next->mc_prev = cp->mc_prev;
    } else {
        mp->mc_last = cp->mc_prev;
    }
    if (cp->mc_prev) {
        cp->mc_prev->mc_next = cp->mc_next;
    } else {
        mp->mc_first = cp->mc_next;
    }
    cp->hdw = NULL;
    pvr2_context_exit(mp);
}