Commit cbd82441 authored by Darron Broad's avatar Darron Broad Committed by Mauro Carvalho Chehab

V4L/DVB (9500): cx88-dvb: MFE attachment fix-up

MFE attachment fix-up
Signed-off-by: default avatarDarron Broad <darron@kewl.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5910e820
...@@ -1199,8 +1199,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) ...@@ -1199,8 +1199,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
{ {
struct cx88_core *core = drv->core; struct cx88_core *core = drv->core;
struct cx8802_dev *dev = drv->core->dvbdev; struct cx8802_dev *dev = drv->core->dvbdev;
int err, i; int err;
struct videobuf_dvb_frontend *fe;
dprintk( 1, "%s\n", __func__); dprintk( 1, "%s\n", __func__);
dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
...@@ -1216,31 +1215,47 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) ...@@ -1216,31 +1215,47 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
/* If vp3054 isn't enabled, a stub will just return 0 */ /* If vp3054 isn't enabled, a stub will just return 0 */
err = vp3054_i2c_probe(dev); err = vp3054_i2c_probe(dev);
if (0 != err) if (0 != err)
goto fail_core; goto fail_probe;
/* dvb stuff */ /* dvb stuff */
printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name); printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name);
dev->ts_gen_cntrl = 0x0c; dev->ts_gen_cntrl = 0x0c;
for (i = 1; i <= core->board.num_frontends; i++) { err = -ENODEV;
fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i); if (core->board.num_frontends) {
if (!fe) { struct videobuf_dvb_frontend *fe;
printk(KERN_ERR "%s() failed to get frontend(%d)\n", __func__, i); int i;
continue;
for (i = 1; i <= core->board.num_frontends; i++) {
fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
if (fe == NULL) {
printk(KERN_ERR "%s() failed to get frontend(%d)\n",
__func__, i);
goto fail_probe;
}
videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
&dev->pci->dev, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_TOP,
sizeof(struct cx88_buffer),
dev);
/* init struct videobuf_dvb */
fe->dvb.name = dev->core->name;
} }
videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops, } else {
&dev->pci->dev, &dev->slock, /* no frontends allocated */
V4L2_BUF_TYPE_VIDEO_CAPTURE, printk(KERN_ERR "%s/2 .num_frontends should be non-zero\n",
V4L2_FIELD_TOP, core->name);
sizeof(struct cx88_buffer), goto fail_core;
dev);
/* init struct videobuf_dvb */
fe->dvb.name = dev->core->name;
} }
err = dvb_register(dev); err = dvb_register(dev);
if (err != 0) if (err)
/* frontends/adapter de-allocated in dvb_register */
printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n",
core->name, err); core->name, err);
return err;
fail_probe:
videobuf_dvb_dealloc_frontends(&core->dvbdev->frontends);
fail_core: fail_core:
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment