aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-dvb.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-02-09 14:29:52 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:47 -0400
commit129a2f5efd95959c44a2bfeea8ee8b7c17252db6 (patch)
tree2a8a4ba1c71171d6e6665c197df79532b25f43dd /drivers/media/video/pvrusb2/pvrusb2-dvb.c
parent7dcc48fb55d18258e7db039f44a031e6828e6bad (diff)
V4L/DVB (7691): pvrusb2-dvb: Don't initialize if device lacks a digital side
In the end we'd like the dvb interface to always be present - even for analog devices (via the mpeg encoder). However right now pvrusb2-dvb won't operate correctly if the hardware doesn't have a digital tuner, so don't initialize the DVB interface unless we know we have a digital tuner. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-dvb.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-dvb.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-dvb.c b/drivers/media/video/pvrusb2/pvrusb2-dvb.c
index f32d052ff4e6..177240051674 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-dvb.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-dvb.c
@@ -401,16 +401,25 @@ int pvr2_dvb_init(struct pvr2_context *pvr)
401{ 401{
402 int ret = 0; 402 int ret = 0;
403 struct pvr2_dvb_adapter *adap; 403 struct pvr2_dvb_adapter *adap;
404 if (!pvr->hdw->hdw_desc->dvb_props) {
405 /* Device lacks a digital interface so don't set up
406 the DVB side of the driver either. For now. */
407 return 0;
408 }
404 adap = &pvr->hdw->dvb; 409 adap = &pvr->hdw->dvb;
405 pvr2_channel_init(&adap->channel, pvr); 410 pvr2_channel_init(&adap->channel, pvr);
406 adap->channel.check_func = pvr2_dvb_internal_check; 411 adap->channel.check_func = pvr2_dvb_internal_check;
407 init_waitqueue_head(&adap->buffer_wait_data); 412 init_waitqueue_head(&adap->buffer_wait_data);
408 mutex_init(&pvr->hdw->dvb.lock); 413 mutex_init(&pvr->hdw->dvb.lock);
409 ret = pvr2_dvb_adapter_init(&pvr->hdw->dvb); 414 ret = pvr2_dvb_adapter_init(&pvr->hdw->dvb);
410 if (ret < 0) goto fail; 415 if (ret < 0) goto fail1;
411 ret = pvr2_dvb_frontend_init(&pvr->hdw->dvb); 416 ret = pvr2_dvb_frontend_init(&pvr->hdw->dvb);
412 return ret; 417 if (ret < 0) goto fail2;
413fail: 418 return 0;
419
420fail2:
421 pvr2_dvb_adapter_exit(adap);
422fail1:
414 pvr2_channel_done(&adap->channel); 423 pvr2_channel_done(&adap->channel);
415 return ret; 424 return ret;
416} 425}