Skip to content

Commit

Permalink
V4L/DVB (7691): pvrusb2-dvb: Don't initialize if device lacks a digit…
Browse files Browse the repository at this point in the history
…al 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>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 7dcc48f commit 129a2f5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions drivers/media/video/pvrusb2/pvrusb2-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,16 +401,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;
}
Expand Down

0 comments on commit 129a2f5

Please sign in to comment.