mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [patch 2.5-bk] PCI 2/3: misc fixes
Date: Wed, 6 Nov 2002 21:07:47 +0300	[thread overview]
Message-ID: <20021106210747.D686@jurassic.park.msu.ru> (raw)

- Use PCI_BUS_NUM_RESOURCES instead on `4' in pci_find_parent_resource;
- clean up pci_claim_resource() and make it a bit more informative;
- pdev_sort_resources() must be __devinit, as it's called from
  pbus_assign_resources_sorted(), which is __devinit now.

Ivan.

--- 2.5-bk/drivers/pci/pci.c	Wed Nov  6 17:38:46 2002
+++ linux/drivers/pci/pci.c	Wed Nov  6 19:54:01 2002
@@ -182,7 +182,7 @@ pci_find_parent_resource(const struct pc
 	int i;
 	struct resource *best = NULL;
 
-	for(i=0; i<4; i++) {
+	for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
 		struct resource *r = bus->resource[i];
 		if (!r)
 			continue;
--- 2.5-bk/drivers/pci/setup-res.c	Tue Nov  5 01:30:49 2002
+++ linux/drivers/pci/setup-res.c	Wed Nov  6 17:26:47 2002
@@ -38,19 +38,18 @@ pci_claim_resource(struct pci_dev *dev, 
 {
         struct resource *res = &dev->resource[resource];
 	struct resource *root = pci_find_parent_resource(dev, res);
+	char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
 	int err;
 
 	err = -EINVAL;
-	if (root != NULL) {
+	if (root != NULL)
 		err = request_resource(root, res);
-		if (err) {
-			printk(KERN_ERR "PCI: Address space collision on "
-			       "region %d of device %s [%lx:%lx]\n",
-			       resource, dev->name, res->start, res->end);
-		}
-	} else {
-		printk(KERN_ERR "PCI: No parent found for region %d "
-		       "of device %s\n", resource, dev->name);
+
+	if (err) {
+		printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n",
+		       root ? "Address space collision on" :
+			      "No parent found for",
+		       resource, dtype, dev->slot_name, res->start, res->end);
 	}
 
 	return err;
@@ -137,7 +136,7 @@ pci_assign_resource(struct pci_dev *dev,
 }
 
 /* Sort resources by alignment */
-void __init
+void __devinit
 pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
 {
 	int i;

             reply	other threads:[~2002-11-06 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 18:07 Ivan Kokshaysky [this message]
2002-11-06 23:27 ` Scott Murray

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=20021106210747.D686@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®