]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] via82cxxx_audio: Use pci_get_device
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Sun, 1 Oct 2006 06:27:26 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 1 Oct 2006 07:39:20 +0000 (00:39 -0700)
pci_find_device is not refcounting and should be getting killed off.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
sound/oss/via82cxxx_audio.c

index 08d8c94d01b21d42073bb84728bd46866f395115..2fec42fc348284bd6a4c20d2ba1aadbf781e51c6 100644 (file)
@@ -1547,7 +1547,7 @@ static int via_mixer_open (struct inode *inode, struct file *file)
 
        DPRINTK ("ENTER\n");
 
-       while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+       while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
                drvr = pci_dev_driver (pdev);
                if (drvr == &via_driver) {
                        assert (pci_get_drvdata (pdev) != NULL);
@@ -1562,6 +1562,7 @@ static int via_mixer_open (struct inode *inode, struct file *file)
        return -ENODEV;
 
 match:
+       pci_dev_put(pdev);
        file->private_data = card->ac97;
 
        DPRINTK ("EXIT, returning 0\n");
@@ -3245,7 +3246,7 @@ static int via_dsp_open (struct inode *inode, struct file *file)
        }
 
        card = NULL;
-       while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+       while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
                drvr = pci_dev_driver (pdev);
                if (drvr == &via_driver) {
                        assert (pci_get_drvdata (pdev) != NULL);
@@ -3264,6 +3265,7 @@ static int via_dsp_open (struct inode *inode, struct file *file)
        return -ENODEV;
 
 match:
+       pci_dev_put(pdev);
        if (nonblock) {
                if (!mutex_trylock(&card->open_mutex)) {
                        DPRINTK ("EXIT, returning -EAGAIN\n");