From: Amit Gud <gud@eth.net>
To: "Amit S. Gud" <gud@eth.net>, greg@kroah.com
Cc: B.Zolnierkiewicz@elka.pw.edu.pl, linux-ide@vger.kernel.org
Subject: Re: [PATCH 21/91] get rid of pci_find_{device,subsys}drivers/ide/pci/hpt366.c
Date: Wed, 30 Mar 2005 15:58:58 +0530 [thread overview]
Message-ID: <424A7F6A.1020005@eth.net> (raw)
In-Reply-To: <ITPXCHFE1b2X5YqE1L70000207f@itpxchfe1.enterprise.veritas.com>
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);
>
next parent reply other threads:[~2005-03-30 10:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ITPXCHFE1b2X5YqE1L70000207f@itpxchfe1.enterprise.veritas.com>
2005-03-30 10:28 ` Amit Gud [this message]
2005-03-30 10:29 ` [PATCH 21/91] get rid of pci_find_{device,subsys}drivers/ide/pci/hpt366.c Amit Gud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=424A7F6A.1020005@eth.net \
--to=gud@eth.net \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=greg@kroah.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).