All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI and sysfs fixes for 2.5.74
Date: Thu, 3 Jul 2003 19:09:13 -0700	[thread overview]
Message-ID: <10572845532660@kroah.com> (raw)
In-Reply-To: <10572845524168@kroah.com>

ChangeSet 1.1365, 2003/07/03 15:51:15-07:00, willy@debian.org

[PATCH] PCI: pci_find_bus needs a domain
Give pci_find_bus a domain argument and move its declaration to <linux/pci.h>


 drivers/pci/hotplug/acpiphp_glue.c     |    2 +-
 drivers/pci/hotplug/cpci_hotplug_pci.c |    2 +-
 drivers/pci/hotplug/ibmphp_core.c      |    6 +++---
 drivers/pci/pci.h                      |    1 -
 drivers/pci/search.c                   |   18 ++++++++++--------
 include/linux/pci.h                    |    1 +
 6 files changed, 16 insertions(+), 14 deletions(-)


diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
--- a/drivers/pci/hotplug/acpiphp_glue.c	Thu Jul  3 18:17:01 2003
+++ b/drivers/pci/hotplug/acpiphp_glue.c	Thu Jul  3 18:17:01 2003
@@ -385,7 +385,7 @@
 	bridge->seg = seg;
 	bridge->bus = bus;
 
-	bridge->pci_bus = pci_find_bus(bus);
+	bridge->pci_bus = pci_find_bus(seg, bus);
 
 	bridge->res_lock = SPIN_LOCK_UNLOCKED;
 
diff -Nru a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c	Thu Jul  3 18:17:01 2003
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c	Thu Jul  3 18:17:01 2003
@@ -395,7 +395,7 @@
 
 	/* Scan behind bridge */
 	n = pci_scan_bridge(bus, dev, max, 2);
-	child = pci_find_bus(max + 1);
+	child = pci_find_bus(0, max + 1);
 	if (!child)
 		return -ENODEV;
 	pci_proc_attach_bus(child);
diff -Nru a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
--- a/drivers/pci/hotplug/ibmphp_core.c	Thu Jul  3 18:17:01 2003
+++ b/drivers/pci/hotplug/ibmphp_core.c	Thu Jul  3 18:17:01 2003
@@ -774,7 +774,7 @@
 	struct pci_dev *dev;
 	u16 l;
 
-	if (pci_find_bus(busno) || !(ibmphp_find_same_bus_num (busno)))
+	if (pci_find_bus(0, busno) || !(ibmphp_find_same_bus_num (busno)))
 		return 1;
 
 	bus = kmalloc (sizeof (*bus), GFP_KERNEL);
@@ -819,7 +819,7 @@
 		func->dev = pci_find_slot (func->busno, PCI_DEVFN(func->device, func->function));
 
 	if (func->dev == NULL) {
-		struct pci_bus *bus = pci_find_bus(func->busno);
+		struct pci_bus *bus = pci_find_bus(0, func->busno);
 		if (!bus)
 			return 0;
 
@@ -1335,7 +1335,7 @@
 		goto exit;
 	}
 
-	bus = pci_find_bus(0);
+	bus = pci_find_bus(0, 0);
 	if (!bus) {
 		err ("Can't find the root pci bus, can not continue\n");
 		rc = -ENODEV;
diff -Nru a/drivers/pci/pci.h b/drivers/pci/pci.h
--- a/drivers/pci/pci.h	Thu Jul  3 18:17:01 2003
+++ b/drivers/pci/pci.h	Thu Jul  3 18:17:01 2003
@@ -29,7 +29,6 @@
 extern unsigned char pci_max_busnr(void);
 extern unsigned char pci_bus_max_busnr(struct pci_bus *bus);
 extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
-extern struct pci_bus *pci_find_bus(unsigned char busnr);
 
 struct pci_dev_wrapped {
 	struct pci_dev	*dev;
diff -Nru a/drivers/pci/search.c b/drivers/pci/search.c
--- a/drivers/pci/search.c	Thu Jul  3 18:17:01 2003
+++ b/drivers/pci/search.c	Thu Jul  3 18:17:01 2003
@@ -31,22 +31,24 @@
 }
 
 /**
- * pci_find_bus - locate PCI bus from a given bus number
+ * pci_find_bus - locate PCI bus from a given domain and bus number
+ * @domain: number of PCI domain to search
  * @busnr: number of desired PCI bus
  *
- * Given a PCI bus number, the desired PCI bus is located in system
- * global list of PCI buses.  If the bus is found, a pointer to its
+ * Given a PCI bus number and domain number, the desired PCI bus is located
+ * in the global list of PCI buses.  If the bus is found, a pointer to its
  * data structure is returned.  If no bus is found, %NULL is returned.
  */
-struct pci_bus *
-pci_find_bus(unsigned char busnr)
+struct pci_bus * pci_find_bus(int domain, int busnr)
 {
-	struct pci_bus* bus = NULL;
-	struct pci_bus* tmp_bus;
+	struct pci_bus *bus = NULL;
+	struct pci_bus *tmp_bus;
 
 	while ((bus = pci_find_next_bus(bus)) != NULL)  {
+		if (pci_domain_nr(bus) != domain)
+			continue;
 		tmp_bus = pci_do_find_bus(bus, busnr);
-		if(tmp_bus)
+		if (tmp_bus)
 			return tmp_bus;
 	}
 	return NULL;
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Thu Jul  3 18:17:01 2003
+++ b/include/linux/pci.h	Thu Jul  3 18:17:01 2003
@@ -543,6 +543,7 @@
 
 /* Generic PCI functions used internally */
 
+extern struct pci_bus *pci_find_bus(int domain, int busnr);
 int pci_bus_exists(const struct list_head *list, int nr);
 struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
 static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)


  reply	other threads:[~2003-07-04  2:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04  2:06 [BK PATCH] PCI and sysfs fixes for 2.5.73 Greg KH
2003-07-04  2:09 ` [PATCH] PCI and sysfs fixes for 2.5.74 Greg KH
2003-07-04  2:09   ` Greg KH
2003-07-04  2:09     ` Greg KH
2003-07-04  2:09       ` Greg KH [this message]
2003-07-04  2:09         ` Greg KH
2003-07-04  2:09           ` Greg KH
2003-07-04  2:09             ` Greg KH
2003-07-04  2:09               ` Greg KH
2003-07-04  2:09                 ` Greg KH
2003-07-04  2:09                   ` Greg KH
2003-07-04  2:09                     ` Greg KH
2003-07-04  2:09                       ` Greg KH
2003-07-04  2:09                         ` Greg KH
2003-07-04  2:09                           ` Greg KH
2003-07-04  2:09                             ` Greg KH
2003-07-04  2:09                               ` Greg KH
2003-07-04  2:09                                 ` Greg KH
2003-07-04  6:52 ` [BK PATCH] PCI and sysfs fixes for 2.5.73 Dan Aloni
2003-07-04 17:05   ` Greg KH

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=10572845532660@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.