diff options
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 11 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-i2c.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-mpeg.c | 15 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 6 |
6 files changed, 21 insertions, 19 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index e71369754305..078be6319556 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -1285,7 +1285,7 @@ static int blackbird_register_video(struct cx8802_dev *dev) return err; } printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n", - dev->core->name,dev->mpeg_dev->minor & 0x1f); + dev->core->name, dev->mpeg_dev->num); return 0; } diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index fbc224f46e0e..5bcbb4cc7c2a 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -3044,8 +3044,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); - if (!core->board.num_frontends) - core->board.num_frontends=1; + if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB)) + core->board.num_frontends = 1; info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n", pci->subsystem_vendor, pci->subsystem_device, core->board.name, diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 6968ab0181aa..cf6c30d4e545 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -789,7 +789,7 @@ static int dvb_register(struct cx8802_dev *dev) if (fe0->dvb.frontend) fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL; if (attach_xc3028(0x61, dev) < 0) - return -EINVAL; + goto frontend_detach; break; case CX88_BOARD_PCHDTV_HD3000: fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, @@ -1058,7 +1058,6 @@ static int dvb_register(struct cx8802_dev *dev) goto frontend_detach; core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage; fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage; - } } break; @@ -1110,10 +1109,7 @@ static int dvb_register(struct cx8802_dev *dev) &dev->pci->dev, adapter_nr, mfe_shared); frontend_detach: - if (fe0->dvb.frontend) { - dvb_frontend_detach(fe0->dvb.frontend); - fe0->dvb.frontend = NULL; - } + videobuf_dvb_dealloc_frontends(&dev->frontends); return -EINVAL; } @@ -1246,8 +1242,11 @@ fail_core: static int cx8802_dvb_remove(struct cx8802_driver *drv) { + struct cx88_core *core = drv->core; struct cx8802_dev *dev = drv->core->dvbdev; + dprintk( 1, "%s\n", __func__); + videobuf_dvb_unregister_bus(&dev->frontends); vp3054_i2c_remove(dev); diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 01de23007095..1ab691d20692 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c @@ -116,8 +116,10 @@ static int detach_inform(struct i2c_client *client) void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) { +#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) struct videobuf_dvb_frontends *f = &core->dvbdev->frontends; struct videobuf_dvb_frontend *fe = NULL; +#endif if (0 != core->i2c_rc) return; diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index 6df5cf314186..a1c435b4b1cd 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c @@ -768,8 +768,11 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, { struct cx8802_dev *dev; struct cx88_core *core; + int err; +#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) struct videobuf_dvb_frontend *demod; - int err,i; + int i; +#endif /* general setup */ core = cx88_core_get(pci_dev); @@ -782,11 +785,6 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, if (!core->board.mpeg) goto fail_core; - if (!core->board.num_frontends) { - printk(KERN_ERR "%s() .num_frontends should be non-zero, err = %d\n", __func__, err); - goto fail_core; - } - err = -ENOMEM; dev = kzalloc(sizeof(*dev),GFP_KERNEL); if (NULL == dev) @@ -801,10 +799,12 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, INIT_LIST_HEAD(&dev->drvlist); list_add_tail(&dev->devlist,&cx8802_devlist); +#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) mutex_init(&dev->frontends.lock); INIT_LIST_HEAD(&dev->frontends.felist); - printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends); + if (core->board.num_frontends) + printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends); for (i = 1; i <= core->board.num_frontends; i++) { demod = videobuf_dvb_alloc_frontend(&dev->frontends, i); @@ -814,6 +814,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, goto fail_free; } } +#endif /* Maintain a reference so cx88-video can query the 8802 device. */ core->dvbdev = dev; diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 3904b73f52ee..61265fd04d56 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -1911,7 +1911,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, goto fail_unreg; } printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n", - core->name,dev->video_dev->minor & 0x1f); + core->name, dev->video_dev->num); dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi"); err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI, @@ -1922,7 +1922,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, goto fail_unreg; } printk(KERN_INFO "%s/0: registered device vbi%d\n", - core->name,dev->vbi_dev->minor & 0x1f); + core->name, dev->vbi_dev->num); if (core->board.radio.type == CX88_RADIO) { dev->radio_dev = cx88_vdev_init(core,dev->pci, @@ -1935,7 +1935,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, goto fail_unreg; } printk(KERN_INFO "%s/0: registered device radio%d\n", - core->name,dev->radio_dev->minor & 0x1f); + core->name, dev->radio_dev->num); } /* everything worked */ |