LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Gud <gud@eth.net>
To: greg@kroah.com
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org, gud@eth.net
Subject: [PATCH 4/91] get rid of pci_find_{device,subsys} arch/ppc
Date: Tue, 29 Mar 2005 17:52:44 +0530	[thread overview]
Message-ID: <ITPXCHFE1Uo1RZEpFid0000206a@itpxchfe1.enterprise.veritas.com> (raw)

Replace pci_find_{device,subsys} with pci_get_{device,subsys}.



Signed-off-by: Amit Gud <gud@eth.net>

---
diff -upr orig-2.6.12-rc1/arch/ppc/kernel/pci.c work-2.6.12-rc1/arch/ppc/kernel/pci.c
--- orig-2.6.12-rc1/arch/ppc/kernel/pci.c	2005-03-22 12:53:17.000000000 +0530
+++ work-2.6.12-rc1/arch/ppc/kernel/pci.c	2005-03-24 15:39:21.107111456 +0530
@@ -503,7 +503,7 @@ pcibios_allocate_resources(int pass)
 	u16 command;
 	struct resource *r;
 
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pci_read_config_word(dev, PCI_COMMAND, &command);
 		for (idx = 0; idx < 6; idx++) {
 			r = &dev->resource[idx];
@@ -519,7 +519,7 @@ pcibios_allocate_resources(int pass)
 				alloc_resource(dev, idx);
 		}
 		if (pass)
-			continue;
+			goto dev_put;
 		r = &dev->resource[PCI_ROM_RESOURCE];
 		if (r->flags & PCI_ROM_ADDRESS_ENABLE) {
 			/* Turn the ROM off, leave the resource region, but keep it unregistered. */
@@ -530,6 +530,8 @@ pcibios_allocate_resources(int pass)
 			pci_write_config_dword(dev, dev->rom_base_reg,
 					       reg & ~PCI_ROM_ADDRESS_ENABLE);
 		}
+		dev_put:
+		  pci_dev_put(dev);
 	}
 }
 
@@ -540,12 +542,12 @@ pcibios_assign_resources(void)
 	int idx;
 	struct resource *r;
 
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		int class = dev->class >> 8;
 
 		/* Don't touch classless devices and host bridges */
 		if (!class || class == PCI_CLASS_BRIDGE_HOST)
-			continue;
+			goto dev_put;
 
 		for (idx = 0; idx < 6; idx++) {
 			r = &dev->resource[idx];
@@ -571,6 +573,8 @@ pcibios_assign_resources(void)
 		if (r->end)
 			pci_assign_resource(dev, PCI_ROM_RESOURCE);
 #endif
+		dev_put:
+		  pci_dev_put(dev);
 	}
 }
 
@@ -866,13 +870,18 @@ pci_device_from_OF_node(struct device_no
 	 */
 	if (!pci_to_OF_bus_map)
 		return 0;
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		if (pci_to_OF_bus_map[dev->bus->number] != *bus)
-			continue;
+			goto dev_put;
 		if (dev->devfn != *devfn)
-			continue;
+			goto dev_put;
+
 		*bus = dev->bus->number;
+		pci_dev_put(dev);
 		return 0;
+
+		dev_put:
+		  pci_dev_put(dev);
 	}
 	return -ENODEV;
 }

             reply	other threads:[~2005-03-29 12:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-29 12:22 Amit Gud [this message]
2005-03-30 10:19 ` [PATCH 4/91] get rid of pci_find_{device,subsys} arch/ppc 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=ITPXCHFE1Uo1RZEpFid0000206a@itpxchfe1.enterprise.veritas.com \
    --to=gud@eth.net \
    --cc=greg@kroah.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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