* Re: [PATCH 21/91] get rid of pci_find_{device,subsys}drivers/ide/pci/hpt366.c
[not found] <ITPXCHFE1b2X5YqE1L70000207f@itpxchfe1.enterprise.veritas.com>
@ 2005-03-30 10:28 ` Amit Gud
2005-03-30 10:29 ` Amit Gud
1 sibling, 0 replies; 2+ messages in thread
From: Amit Gud @ 2005-03-30 10:28 UTC (permalink / raw)
To: Amit S. Gud, greg; +Cc: B.Zolnierkiewicz, linux-ide
Amit S. Gud wrote:
> Replace pci_find_{device,subsys} with pci_get_{device,subsys}.
>
>
> Signed-off-by: Amit S. Gud <gud@eth.net>
>
> ---
> --- orig-2.6.12-rc1/drivers/ide/pci/hpt366.c 2005-03-15 21:01:10.000000000 +0530
> +++ work-2.6.12-rc1/drivers/ide/pci/hpt366.c 2005-03-29 16:53:14.428577208 +0530
> @@ -1562,11 +1562,12 @@ static void __devinit init_dma_hpt366(id
> static int __devinit init_setup_hpt374(struct pci_dev *dev, ide_pci_device_t *d)
> {
> struct pci_dev *findev = NULL;
> + int ret;
>
> if (PCI_FUNC(dev->devfn) & 1)
> return -ENODEV;
>
> - while ((findev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
> + while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
> if ((findev->vendor == dev->vendor) &&
> (findev->device == dev->device) &&
> ((findev->devfn - dev->devfn) == 1) &&
> @@ -1577,8 +1578,11 @@ static int __devinit init_setup_hpt374(s
> printk(KERN_WARNING "%s: pci-config space interrupt "
> "fixed.\n", d->name);
> }
> - return ide_setup_pci_devices(dev, findev, d);
> + ret = ide_setup_pci_devices(dev, findev, d);
> + pci_dev_put(findev);
> + return ret;
> }
> + pci_dev_put(findev);
> }
> return ide_setup_pci_device(dev, d);
> }
> @@ -1593,6 +1597,7 @@ static int __devinit init_setup_hpt366(s
> struct pci_dev *findev = NULL;
> u8 pin1 = 0, pin2 = 0;
> unsigned int class_rev;
> + int ret;
> char *chipset_names[] = {"HPT366", "HPT366", "HPT368",
> "HPT370", "HPT370A", "HPT372",
> "HPT372N" };
> @@ -1622,7 +1627,7 @@ static int __devinit init_setup_hpt366(s
> d->channels = 1;
>
> pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1);
> - while ((findev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
> + while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
> if ((findev->vendor == dev->vendor) &&
> (findev->device == dev->device) &&
> ((findev->devfn - dev->devfn) == 1) &&
> @@ -1634,8 +1639,11 @@ static int __devinit init_setup_hpt366(s
> "pin1=%d pin2=%d\n", d->name,
> pin1, pin2);
> }
> - return ide_setup_pci_devices(dev, findev, d);
> + ret = ide_setup_pci_devices(dev, findev, d);
> + pci_dev_put(findev);
> + return ret;
> }
> + pci_dev_put(findev);
> }
> init_single:
> return ide_setup_pci_device(dev, d);
>
^ permalink raw reply [flat|nested] 2+ messages in thread