diff options
author | Darron Broad <darron@kewl.org> | 2008-10-30 04:07:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:25 -0500 |
commit | cbd82441065820190960aae1b1cfb09bff366ad6 (patch) | |
tree | 97f30c16d4f4e8d38311f5396c1cc576f6051eed /drivers/media/video/cx88/cx88-dvb.c | |
parent | 5910e820cdaaf0b7120c96647d10e3ce52d840b7 (diff) |
V4L/DVB (9500): cx88-dvb: MFE attachment fix-up
MFE attachment fix-up
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 309ca5e6806..8378d46dc80 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -1199,8 +1199,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) | |||
1199 | { | 1199 | { |
1200 | struct cx88_core *core = drv->core; | 1200 | struct cx88_core *core = drv->core; |
1201 | struct cx8802_dev *dev = drv->core->dvbdev; | 1201 | struct cx8802_dev *dev = drv->core->dvbdev; |
1202 | int err, i; | 1202 | int err; |
1203 | struct videobuf_dvb_frontend *fe; | ||
1204 | 1203 | ||
1205 | dprintk( 1, "%s\n", __func__); | 1204 | dprintk( 1, "%s\n", __func__); |
1206 | dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", | 1205 | 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 | /* If vp3054 isn't enabled, a stub will just return 0 */ | 1215 | /* If vp3054 isn't enabled, a stub will just return 0 */ |
1217 | err = vp3054_i2c_probe(dev); | 1216 | err = vp3054_i2c_probe(dev); |
1218 | if (0 != err) | 1217 | if (0 != err) |
1219 | goto fail_core; | 1218 | goto fail_probe; |
1220 | 1219 | ||
1221 | /* dvb stuff */ | 1220 | /* dvb stuff */ |
1222 | printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name); | 1221 | printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name); |
1223 | dev->ts_gen_cntrl = 0x0c; | 1222 | dev->ts_gen_cntrl = 0x0c; |
1224 | 1223 | ||
1225 | for (i = 1; i <= core->board.num_frontends; i++) { | 1224 | err = -ENODEV; |
1226 | fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i); | 1225 | if (core->board.num_frontends) { |
1227 | if (!fe) { | 1226 | struct videobuf_dvb_frontend *fe; |
1228 | printk(KERN_ERR "%s() failed to get frontend(%d)\n", __func__, i); | 1227 | int i; |
1229 | continue; | 1228 | |
1229 | for (i = 1; i <= core->board.num_frontends; i++) { | ||
1230 | fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i); | ||
1231 | if (fe == NULL) { | ||
1232 | printk(KERN_ERR "%s() failed to get frontend(%d)\n", | ||
1233 | __func__, i); | ||
1234 | goto fail_probe; | ||
1235 | } | ||
1236 | videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops, | ||
1237 | &dev->pci->dev, &dev->slock, | ||
1238 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | ||
1239 | V4L2_FIELD_TOP, | ||
1240 | sizeof(struct cx88_buffer), | ||
1241 | dev); | ||
1242 | /* init struct videobuf_dvb */ | ||
1243 | fe->dvb.name = dev->core->name; | ||
1230 | } | 1244 | } |
1231 | videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops, | 1245 | } else { |
1232 | &dev->pci->dev, &dev->slock, | 1246 | /* no frontends allocated */ |
1233 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 1247 | printk(KERN_ERR "%s/2 .num_frontends should be non-zero\n", |
1234 | V4L2_FIELD_TOP, | 1248 | core->name); |
1235 | sizeof(struct cx88_buffer), | 1249 | goto fail_core; |
1236 | dev); | ||
1237 | /* init struct videobuf_dvb */ | ||
1238 | fe->dvb.name = dev->core->name; | ||
1239 | } | 1250 | } |
1240 | err = dvb_register(dev); | 1251 | err = dvb_register(dev); |
1241 | if (err != 0) | 1252 | if (err) |
1253 | /* frontends/adapter de-allocated in dvb_register */ | ||
1242 | printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", | 1254 | printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", |
1243 | core->name, err); | 1255 | core->name, err); |
1256 | return err; | ||
1257 | fail_probe: | ||
1258 | videobuf_dvb_dealloc_frontends(&core->dvbdev->frontends); | ||
1244 | fail_core: | 1259 | fail_core: |
1245 | return err; | 1260 | return err; |
1246 | } | 1261 | } |