lkml.org 
[lkml]   [2003]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] More PCI fixes for 2.5.73
From
Date
ChangeSet 1.1429.2.5, 2003/06/25 17:08:13-07:00, willy@debian.org

[PATCH] PCI: fixes for pci/probe.c

- Combine pci_alloc_primary_bus_parented into pci_scan_bus_parented.
- Move the EXPORT_SYMBOL for pci_root_buses up to its definition.
- Don't EXPORT_SYMBOL pci_scan_bus since it's a static inline.
- Add the pci_domain_nr() to the sysfs name for this bus.


drivers/pci/probe.c | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)


diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c Wed Jun 25 17:38:03 2003
+++ b/drivers/pci/probe.c Wed Jun 25 17:38:03 2003
@@ -18,7 +18,10 @@
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
#define CARDBUS_RESERVE_BUSNR 3

+/* Ugh. Need to stop exporting this to modules. */
LIST_HEAD(pci_root_buses);
+EXPORT_SYMBOL(pci_root_buses);
+
LIST_HEAD(pci_devices);

/*
@@ -643,7 +646,7 @@
return 0;
}

-static struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *parent, int bus)
+struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
{
struct pci_bus *b;

@@ -656,46 +659,39 @@
b = pci_alloc_bus();
if (!b)
return NULL;
-
+
b->dev = kmalloc(sizeof(*(b->dev)),GFP_KERNEL);
if (!b->dev){
kfree(b);
return NULL;
}
-
+
+ b->sysdata = sysdata;
+ b->ops = ops;
+
list_add_tail(&b->node, &pci_root_buses);

memset(b->dev,0,sizeof(*(b->dev)));
- sprintf(b->dev->bus_id,"pci%d",bus);
- strcpy(b->dev->name,"Host/PCI Bridge");
b->dev->parent = parent;
+ sprintf(b->dev->bus_id,"pci%04x:%02x", pci_domain_nr(b), bus);
+ strcpy(b->dev->name,"Host/PCI Bridge");
device_register(b->dev);

b->number = b->secondary = bus;
b->resource[0] = &ioport_resource;
b->resource[1] = &iomem_resource;
- return b;
-}

-struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
-{
- struct pci_bus *b = pci_alloc_primary_bus_parented(parent, bus);
- if (b) {
- b->sysdata = sysdata;
- b->ops = ops;
- b->subordinate = pci_scan_child_bus(b);
- pci_bus_add_devices(b);
- }
+ b->subordinate = pci_scan_child_bus(b);
+
+ pci_bus_add_devices(b);
+
return b;
}
EXPORT_SYMBOL(pci_scan_bus_parented);

-EXPORT_SYMBOL(pci_root_buses);
-
#ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pci_add_new_bus);
EXPORT_SYMBOL(pci_do_scan_bus);
EXPORT_SYMBOL(pci_scan_slot);
-EXPORT_SYMBOL(pci_scan_bus);
EXPORT_SYMBOL(pci_scan_bridge);
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.897 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site