public inbox for linux-kernel@vger.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: <10572845531561@kroah.com> (raw)
In-Reply-To: <10572845532660@kroah.com>

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

[PATCH] PCI: Remove pci_bus_exists
Convert all callers of pci_bus_exists() to call pci_find_bus() instead.
Since all callers of pci_find_bus() are __init or __devinit, mark it as
__devinit too.


 arch/i386/pci/legacy.c              |    2 +-
 arch/sh/kernel/cpu/sh4/pci-sh7751.c |    2 +-
 drivers/pci/probe.c                 |   13 +------------
 drivers/pci/search.c                |    5 +++--
 include/linux/pci.h                 |    1 -
 5 files changed, 6 insertions(+), 17 deletions(-)


diff -Nru a/arch/i386/pci/legacy.c b/arch/i386/pci/legacy.c
--- a/arch/i386/pci/legacy.c	Thu Jul  3 18:16:55 2003
+++ b/arch/i386/pci/legacy.c	Thu Jul  3 18:16:55 2003
@@ -28,7 +28,7 @@
 	}
 
 	for (n=0; n <= pcibios_last_bus; n++) {
-		if (pci_bus_exists(&pci_root_buses, n))
+		if (pci_find_bus(0, n))
 			continue;
 		bus->number = n;
 		bus->ops = &pci_root_ops;
diff -Nru a/arch/sh/kernel/cpu/sh4/pci-sh7751.c b/arch/sh/kernel/cpu/sh4/pci-sh7751.c
--- a/arch/sh/kernel/cpu/sh4/pci-sh7751.c	Thu Jul  3 18:16:55 2003
+++ b/arch/sh/kernel/cpu/sh4/pci-sh7751.c	Thu Jul  3 18:16:55 2003
@@ -200,7 +200,7 @@
 		return;
 	PCIDBG(2,"PCI: Peer bridge fixup\n");
 	for (n=0; n <= pcibios_last_bus; n++) {
-		if (pci_bus_exists(&pci_root_buses, n))
+		if (pci_find_bus(0, n))
 			continue;
 		bus.number = n;
 		bus.ops = pci_root_ops;
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	Thu Jul  3 18:16:55 2003
+++ b/drivers/pci/probe.c	Thu Jul  3 18:16:55 2003
@@ -633,22 +633,11 @@
 	return max;
 }
 
-int __devinit pci_bus_exists(const struct list_head *list, int nr)
-{
-	const struct pci_bus *b;
-
-	list_for_each_entry(b, list, node) {
-		if (b->number == nr || pci_bus_exists(&b->children, nr))
-			return 1;
-	}
-	return 0;
-}
-
 struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
 {
 	struct pci_bus *b;
 
-	if (pci_bus_exists(&pci_root_buses, bus)) {
+	if (pci_find_bus(0, bus)) {
 		/* If we already got to this bus through a different bridge, ignore it */
 		DBG("PCI: Bus %02x already known\n", bus);
 		return NULL;
diff -Nru a/drivers/pci/search.c b/drivers/pci/search.c
--- a/drivers/pci/search.c	Thu Jul  3 18:16:55 2003
+++ b/drivers/pci/search.c	Thu Jul  3 18:16:55 2003
@@ -7,13 +7,14 @@
  *	Copyright 2003 -- Greg Kroah-Hartman <greg@kroah.com>
  */
 
+#include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 
 spinlock_t pci_bus_lock = SPIN_LOCK_UNLOCKED;
 
-static struct pci_bus *
+static struct pci_bus * __devinit
 pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
 {
 	struct pci_bus* child;
@@ -39,7 +40,7 @@
  * 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(int domain, int busnr)
+struct pci_bus * __devinit pci_find_bus(int domain, int busnr)
 {
 	struct pci_bus *bus = NULL;
 	struct pci_bus *tmp_bus;
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Thu Jul  3 18:16:55 2003
+++ b/include/linux/pci.h	Thu Jul  3 18:16:55 2003
@@ -544,7 +544,6 @@
 /* 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  1:56 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
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  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=10572845531561@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox