Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92761
b: refs/heads/master
c: 891d99e
h: refs/heads/master
i:
  92759: 72fb0c6
v: v3
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 0187ff0 commit 5e85e5f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a36416d0a70899d3724d2e69e378062e06252a41
refs/heads/master: 891d99efc5be16d2762bdbb9d0486f7250990eee
31 changes: 19 additions & 12 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,30 +386,37 @@ static int pvr2_dvb_frontend_exit(struct pvr2_dvb_adapter *adap)
return 0;
}

static void pvr2_dvb_done(struct pvr2_dvb_adapter *adap)
{
pvr2_dvb_stream_end(adap);
pvr2_dvb_frontend_exit(adap);
pvr2_dvb_adapter_exit(adap);
pvr2_channel_done(&adap->channel);
}

static void pvr2_dvb_internal_check(struct pvr2_channel *chp)
{
struct pvr2_dvb_adapter *adap;
adap = container_of(chp, struct pvr2_dvb_adapter, channel);
if (!adap->channel.mc_head->disconnect_flag) return;
pvr2_dvb_done(adap);
}

int pvr2_dvb_init(struct pvr2_context *pvr)
{
int ret = 0;
struct pvr2_dvb_adapter *adap;
adap = &pvr->hdw->dvb;
adap->init = !0;
pvr2_channel_init(&adap->channel, pvr);
adap->channel.check_func = pvr2_dvb_internal_check;
init_waitqueue_head(&adap->buffer_wait_data);
mutex_init(&pvr->hdw->dvb.lock);
ret = pvr2_dvb_adapter_init(&pvr->hdw->dvb);
if (ret < 0) goto fail;
ret = pvr2_dvb_frontend_init(&pvr->hdw->dvb);
return ret;
fail:
pvr2_channel_done(&adap->channel);
return ret;
}

int pvr2_dvb_exit(struct pvr2_context *pvr)
{
struct pvr2_dvb_adapter *adap;
adap = &pvr->hdw->dvb;
if (!adap->init) return 0;
pvr2_dvb_stream_end(adap);
pvr2_dvb_frontend_exit(adap);
pvr2_dvb_adapter_exit(adap);
pvr2_channel_done(&adap->channel);
return 0;
}
2 changes: 0 additions & 2 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-dvb.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct pvr2_dvb_adapter {

unsigned int digital_up:1;
unsigned int stream_run:1;
unsigned int init:1;

wait_queue_head_t buffer_wait_data;
char *buffer_storage[PVR2_DVB_BUFFER_COUNT];
Expand All @@ -39,6 +38,5 @@ struct pvr2_dvb_props {
};

int pvr2_dvb_init(struct pvr2_context *pvr);
int pvr2_dvb_exit(struct pvr2_context *pvr);

#endif /* __PVRUSB2_DVB_H__ */
3 changes: 0 additions & 3 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ static void pvr_disconnect(struct usb_interface *intf)

pvr2_trace(PVR2_TRACE_INIT,"pvr_disconnect(pvr=%p) BEGIN",pvr);

#ifdef CONFIG_VIDEO_PVRUSB2_DVB
pvr2_dvb_exit(pvr);
#endif
usb_set_intfdata (intf, NULL);
pvr2_context_disconnect(pvr);

Expand Down

0 comments on commit 5e85e5f

Please sign in to comment.