aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-mpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-mpeg.c')
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index a6b061c2644a..22c2a88fbf1c 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -768,7 +768,8 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
768{ 768{
769 struct cx8802_dev *dev; 769 struct cx8802_dev *dev;
770 struct cx88_core *core; 770 struct cx88_core *core;
771 int err; 771 struct videobuf_dvb_frontend *demod;
772 int err,i;
772 773
773 /* general setup */ 774 /* general setup */
774 core = cx88_core_get(pci_dev); 775 core = cx88_core_get(pci_dev);
@@ -781,6 +782,11 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
781 if (!core->board.mpeg) 782 if (!core->board.mpeg)
782 goto fail_core; 783 goto fail_core;
783 784
785 if (!core->board.num_frontends) {
786 printk(KERN_ERR "%s() .num_frontends should be non-zero, err = %d\n", __FUNCTION__, err);
787 goto fail_core;
788 }
789
784 err = -ENOMEM; 790 err = -ENOMEM;
785 dev = kzalloc(sizeof(*dev),GFP_KERNEL); 791 dev = kzalloc(sizeof(*dev),GFP_KERNEL);
786 if (NULL == dev) 792 if (NULL == dev)
@@ -795,6 +801,20 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
795 INIT_LIST_HEAD(&dev->drvlist); 801 INIT_LIST_HEAD(&dev->drvlist);
796 list_add_tail(&dev->devlist,&cx8802_devlist); 802 list_add_tail(&dev->devlist,&cx8802_devlist);
797 803
804 mutex_init(&dev->frontends.lock);
805 INIT_LIST_HEAD(&dev->frontends.frontend.felist);
806
807 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __FUNCTION__, core->board.num_frontends);
808
809 for (i = 1; i <= core->board.num_frontends; i++) {
810 demod = videobuf_dvb_alloc_frontend(dev, &dev->frontends, i);
811 if(demod == NULL) {
812 printk(KERN_ERR "%s() failed to alloc\n", __FUNCTION__);
813 err = -ENOMEM;
814 goto fail_free;
815 }
816 }
817
798 /* Maintain a reference so cx88-video can query the 8802 device. */ 818 /* Maintain a reference so cx88-video can query the 8802 device. */
799 core->dvbdev = dev; 819 core->dvbdev = dev;
800 820