* [patch 2.5-bk] PCI 2/3: misc fixes
@ 2002-11-06 18:07 Ivan Kokshaysky
2002-11-06 23:27 ` Scott Murray
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Kokshaysky @ 2002-11-06 18:07 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
- 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 2.5-bk] PCI 2/3: misc fixes
2002-11-06 18:07 [patch 2.5-bk] PCI 2/3: misc fixes Ivan Kokshaysky
@ 2002-11-06 23:27 ` Scott Murray
0 siblings, 0 replies; 2+ messages in thread
From: Scott Murray @ 2002-11-06 23:27 UTC (permalink / raw)
To: Ivan Kokshaysky; +Cc: Linus Torvalds, linux-kernel
On Wed, 6 Nov 2002, Ivan Kokshaysky wrote:
> - 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.
My apologies about pdev_sort_resources, I completely missed it when I was
pushing __devinit down from pbus_assign_resources.
Scott
--
Scott Murray
SOMA Networks, Inc.
Toronto, Ontario
e-mail: scottm@somanetworks.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-06 23:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 18:07 [patch 2.5-bk] PCI 2/3: misc fixes Ivan Kokshaysky
2002-11-06 23:27 ` Scott Murray
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®