summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-02-09 10:29:52 -0600
committerMike Isely <isely@pobox.com>2008-02-09 10:29:52 -0600
commit5097f23fd0dd7f3b82f9ebe424274041ad184b2b (patch)
treea68d7c5bc4c35f7caf5715257858cbab5d6deb02 /linux/drivers/media
parentc2d538737e28749e6b8d83a83e67809bd93bb805 (diff)
downloadmediapointer-dvb-s2-5097f23fd0dd7f3b82f9ebe424274041ad184b2b.tar.gz
mediapointer-dvb-s2-5097f23fd0dd7f3b82f9ebe424274041ad184b2b.tar.bz2
pvrusb2-dvb: Don't initialize if device lacks a digital side
From: Mike Isely <isely@pobox.com> 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>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c
index 0c06e8753..0b3eb6d84 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c
@@ -419,16 +419,25 @@ int pvr2_dvb_init(struct pvr2_context *pvr)
{
int ret = 0;
struct pvr2_dvb_adapter *adap;
+ if (!pvr->hdw->hdw_desc->dvb_props) {
+ /* Device lacks a digital interface so don't set up
+ the DVB side of the driver either. For now. */
+ return 0;
+ }
adap = &pvr->hdw->dvb;
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;
+ if (ret < 0) goto fail1;
ret = pvr2_dvb_frontend_init(&pvr->hdw->dvb);
- return ret;
-fail:
+ if (ret < 0) goto fail2;
+ return 0;
+
+fail2:
+ pvr2_dvb_adapter_exit(adap);
+fail1:
pvr2_channel_done(&adap->channel);
return ret;
}