mirror of https://gitee.com/openkylin/linux.git
pdc202xx_new: fix PCI refcounting
The driver erroneously "lets go" the mate IDE chip in init_setup_pdc20270() when ide_setup_pci_devices() call succeeds -- fix this, and drop a couple of useless assignments in this function while at it... Bart: keep "findev" variable initialization to silence gcc Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
0505b55fb5
commit
35198234a2
|
@ -9,7 +9,7 @@
|
|||
* Split from:
|
||||
* linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
|
||||
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
|
||||
* Copyright (C) 2005-2006 MontaVista Software, Inc.
|
||||
* Copyright (C) 2005-2007 MontaVista Software, Inc.
|
||||
* Portions Copyright (C) 1999 Promise Technology, Inc.
|
||||
* Author: Frank Tiernan (frankt@promise.com)
|
||||
* Released under terms of General Public License
|
||||
|
@ -535,7 +535,7 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
|
|||
(dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) {
|
||||
if (PCI_SLOT(dev->devfn) & 2)
|
||||
return -ENODEV;
|
||||
d->extra = 0;
|
||||
|
||||
while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
|
||||
if ((findev->vendor == dev->vendor) &&
|
||||
(findev->device == dev->device) &&
|
||||
|
@ -544,6 +544,7 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
|
|||
findev->irq = dev->irq;
|
||||
}
|
||||
ret = ide_setup_pci_devices(dev, findev, d);
|
||||
if (ret < 0)
|
||||
pci_dev_put(findev);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue