diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-13 12:02:43 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-13 12:02:43 +0100 |
commit | 611e15a080c06e90f91feee1be742463a0e256d6 (patch) | |
tree | c719fb2469d5c671d01d7931dab0d67a4f1a2c72 /linux/drivers/media/video/cx23885/cx23885-core.c | |
parent | 69357393e580dbcd400c7c1992b48813359eb417 (diff) | |
download | mediapointer-dvb-s2-611e15a080c06e90f91feee1be742463a0e256d6.tar.gz mediapointer-dvb-s2-611e15a080c06e90f91feee1be742463a0e256d6.tar.bz2 |
cx23885: convert to v4l2_device.
From: Hans Verkuil <hverkuil@xs4all.nl>
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx23885/cx23885-core.c')
-rw-r--r-- | linux/drivers/media/video/cx23885/cx23885-core.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/linux/drivers/media/video/cx23885/cx23885-core.c b/linux/drivers/media/video/cx23885/cx23885-core.c index d894d4900..eea0bc650 100644 --- a/linux/drivers/media/video/cx23885/cx23885-core.c +++ b/linux/drivers/media/video/cx23885/cx23885-core.c @@ -1750,16 +1750,20 @@ static int __devinit cx23885_initdev(struct pci_dev *pci_dev, if (NULL == dev) return -ENOMEM; + err = v4l2_device_register(&pci_dev->dev, &dev->v4l2_dev); + if (err < 0) + goto fail_free; + /* pci init */ dev->pci = pci_dev; if (pci_enable_device(pci_dev)) { err = -EIO; - goto fail_free; + goto fail_unreg; } if (cx23885_dev_setup(dev) < 0) { err = -EINVAL; - goto fail_free; + goto fail_unreg; } /* print pci info */ @@ -1786,8 +1790,6 @@ static int __devinit cx23885_initdev(struct pci_dev *pci_dev, goto fail_irq; } - pci_set_drvdata(pci_dev, dev); - switch (dev->board) { case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: cx_set(PCI_INT_MSK, 0x01800000); /* for NetUP */ @@ -1798,6 +1800,8 @@ static int __devinit cx23885_initdev(struct pci_dev *pci_dev, fail_irq: cx23885_dev_unregister(dev); +fail_unreg: + v4l2_device_unregister(&dev->v4l2_dev); fail_free: kfree(dev); return err; @@ -1805,7 +1809,8 @@ fail_free: static void __devexit cx23885_finidev(struct pci_dev *pci_dev) { - struct cx23885_dev *dev = pci_get_drvdata(pci_dev); + struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); + struct cx23885_dev *dev = to_cx23885(v4l2_dev); cx23885_shutdown(dev); @@ -1813,13 +1818,13 @@ static void __devexit cx23885_finidev(struct pci_dev *pci_dev) /* unregister stuff */ free_irq(pci_dev->irq, dev); - pci_set_drvdata(pci_dev, NULL); mutex_lock(&devlist); list_del(&dev->devlist); mutex_unlock(&devlist); cx23885_dev_unregister(dev); + v4l2_device_unregister(v4l2_dev); kfree(dev); } |