# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/02/08 12:23:18-08:00 brking@us.ibm.com 
#   [PATCH] PCI: Dynids - passing driver data
#   
#   Currently, code exists in the pci layer to allow userspace to specify
#   driver data when adding a pci dynamic id from sysfs. However, this data
#   is never used and there exists no way in the existing code to use it.
#   This patch allows device drivers to indicate that they want driver data
#   passed to them on dynamic id adds by initializing use_driver_data in their
#   pci_driver->pci_dynids struct. The documentation has also been updated
#   to reflect this.
#   
#   Signed-off-by: Brian King <brking@us.ibm.com>
#   Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
# 
# drivers/pci/pci-driver.c
#   2005/02/07 13:58:21-08:00 brking@us.ibm.com +0 -1
#   PCI: Dynids - passing driver data
# 
# Documentation/pci.txt
#   2005/02/07 13:58:21-08:00 brking@us.ibm.com +4 -4
#   PCI: Dynids - passing driver data
# 
# ChangeSet
#   2005/02/08 12:22:53-08:00 Mark.Haigh@spirentcom.com 
#   [PATCH] arch/i386/kernel/pci/irq.c:  Wrong message output
#   
#   The following has been reported in the wild for kernel 2.6.8-24:
#   
#   PCI: Enabling device 0000:00:05.0 (0000 -> 0002)
#   PCI: No IRQ known for interrupt pin @ of device 0000:00:05.0. Probably
#   buggy MP table.
#   
#   It should read "No IRQ known for interrupt pin A", but the 'pin'
#   variable has already been decremented (from 1 to 0), so the line:
#   
#   printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device
#   %s.%s\n", 'A' + pin - 1, dev->slot_name, msg);
#   
#   causes "pin @" to be output, because 'A' + 0 - 1 == '@'.
#   
#   The supplied patch should fix it.  It also removes a redundant check for
#   a nonzero pin.
#   
#   Signed-off-by: Mark F. Haigh  <Mark.Haigh@spirentcom.com>
#   Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
# 
# arch/i386/pci/irq.c
#   2005/02/07 21:39:15-08:00 Mark.Haigh@spirentcom.com +36 -37
#   arch/i386/kernel/pci/irq.c:  Wrong message output
# 
# ChangeSet
#   2005/02/07 16:21:16-08:00 bjorn.helgaas@hp.com 
#   [PATCH] PCI: pci_raw_ops should use unsigned args
#   
#   Convert pci_raw_ops to use unsigned segment (aka domain),
#   bus, and devfn.  With the previous code, various ia64 config
#   accesses fail due to segment sign-extension problems.
#   
#   ia64:
#       - With a signed seg >= 0x8, unwanted sign-extension occurs when
#         "seg << 28" is cast to u64 in PCI_SAL_EXT_ADDRESS()
#       - PCI_SAL_EXT_ADDRESS(): cast to u64 *before* shifting; otherwise
#         "seg << 28" is evaluated as unsigned int (32 bits) and gets
#         truncated when seg > 0xf
#       - pci_sal_read(): validate "value" ptr as other arches do
#       - pci_sal_{read,write}(): return -EINVAL rather than SAL error status
#   
#    arch/i386/pci/direct.c     |   12 ++++++----
#    arch/i386/pci/mmconfig.c   |    6 +++--
#    arch/i386/pci/numa.c       |    6 +++--
#    arch/i386/pci/pcbios.c     |    6 +++--
#    arch/ia64/pci/pci.c        |   53 ++++++++++++++++++---------------------------
#    arch/x86_64/pci/mmconfig.c |    8 ++++--
#    include/linux/pci.h        |    6 +++--
#    7 files changed, 51 insertions(+), 46 deletions(-)
#   
#   Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
#   Acked-by: Matthew Wilcox <matthew@wil.cx>
#   Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
# 
# include/linux/pci.h
#   2005/02/03 10:08:22-08:00 bjorn.helgaas@hp.com +4 -2
#   PCI: pci_raw_ops should use unsigned args
# 
# arch/x86_64/pci/mmconfig.c
#   2005/02/03 10:08:22-08:00 bjorn.helgaas@hp.com +5 -3
#   PCI: pci_raw_ops should use unsigned args
# 
# arch/ia64/pci/pci.c
#   2005/02/03 10:08:22-08:00 bjorn.helgaas@hp.com +22 -31
#   PCI: pci_raw_ops should use unsigned args
# 
# arch/i386/pci/pcbios.c
#   2005/02/03 10:08:21-08:00 bjorn.helgaas@hp.com +4 -2
#   PCI: pci_raw_ops should use unsigned args
# 
# arch/i386/pci/numa.c
#   2005/02/03 10:55:05-08:00 bjorn.helgaas@hp.com +4 -2
#   PCI: pci_raw_ops should use unsigned args
# 
# arch/i386/pci/mmconfig.c
#   2005/02/03 10:08:21-08:00 bjorn.helgaas@hp.com +4 -2
#   PCI: pci_raw_ops should use unsigned args
# 
# arch/i386/pci/direct.c
#   2005/02/03 10:08:21-08:00 bjorn.helgaas@hp.com +8 -4
#   PCI: pci_raw_ops should use unsigned args
# 
# ChangeSet
#   2005/02/07 16:20:50-08:00 bjorn.helgaas@hp.com 
#   [PATCH] PCI: NUMA-Q PCI config access arg validation
#   
#   Fix NUMA-Q PCI config access bus validation.  "bus" indexes
#   into BUS2QUAD, which is mp_bus_id_to_node[MAX_MP_BUSSES].
#   
#   This depends on the "pci_raw_ops should use unsigned args"
#   patch I posted earlier today (no functional dependency; it
#   just happens to be very close textually).
#   
#   Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
#   Signed-off-by: Martin J. Bligh <mbligh@aracnet.com>
#   Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
# 
# arch/i386/pci/numa.c
#   2005/02/03 15:24:27-08:00 bjorn.helgaas@hp.com +2 -2
#   PCI: NUMA-Q PCI config access arg validation
# 
# ChangeSet
#   2005/02/07 16:20:26-08:00 muneda.takahiro@jp.fujitsu.com 
#   [PATCH] PCI: fix pci_remove_legacy_files() crash
#   
#   The legacy_io which is the member of pci_bus struct might be
#   NULL. It should be checked.
#   
#   This patch checks 'b->legacy_io', NULL or not.
#   
#   Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
#   Acked-by: Jesse Barnes <jbarnes@sgi.com>
#   Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
# 
# drivers/pci/probe.c
#   2005/02/02 18:21:51-08:00 muneda.takahiro@jp.fujitsu.com +5 -3
#   PCI: fix pci_remove_legacy_files() crash
# 
# ChangeSet
#   2005/02/07 14:38:32-08:00 matthew@wil.cx 
#   [PATCH] PCI: Make pci_claim_resource __devinit
#   
#   ia64 calls pci_claim_resource() from pcibios_fixup_bus(), which is
#   __devinit, so pci_claim_resource() needs to be __devinit too.
#   
#   Signed-off-by: Matthew Wilcox <matthew@wil.cx>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/pci/setup-res.c
#   2005/02/07 12:51:58-08:00 matthew@wil.cx +1 -1
#   PCI: Make pci_claim_resource __devinit
# 
# ChangeSet
#   2005/02/07 14:38:06-08:00 matthew@wil.cx 
#   [PATCH] PCI: pci_proc_domain
#   
#   There's no need for the architectures to know how to name busses,
#   so replace pci_name_bus with pci_proc_domain -- a predicate to allow
#   architectures to choose whether domains are included in /proc/bus/pci
#   or not.  I've converted all architectures but only tested ia64 and a
#   CONFIG_PCI_DOMAINS=n build.
#   
#   Signed-off-by: Matthew Wilcox <matthew@wil.cx>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# include/linux/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +1 -2
#   PCI: pci_proc_domain
# 
# include/asm-sparc64/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +4 -1
#   PCI: pci_proc_domain
# 
# include/asm-ppc64/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +2 -2
#   PCI: pci_proc_domain
# 
# include/asm-ppc/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +1 -2
#   PCI: pci_proc_domain
# 
# include/asm-mips/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +2 -9
#   PCI: pci_proc_domain
# 
# include/asm-ia64/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +2 -7
#   PCI: pci_proc_domain
# 
# include/asm-alpha/pci.h
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +2 -9
#   PCI: pci_proc_domain
# 
# drivers/pci/proc.c
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +13 -7
#   PCI: pci_proc_domain
# 
# arch/sparc64/kernel/pci.c
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +0 -6
#   PCI: pci_proc_domain
# 
# arch/ppc64/kernel/pci.c
#   2005/02/07 12:52:02-08:00 matthew@wil.cx +6 -10
#   PCI: pci_proc_domain
# 
# ChangeSet
#   2005/02/07 14:37:42-08:00 eike-hotplug@sf-tec.de 
#   [PATCH] PCI Hotplug: Remove unneeded instructions from ibmphp_pci.c
#   
#   this patch removes some unneeded code from ibmphp_pci.c. First I thought it
#   is a bug and the second line should have been "sec_no = (int) sec_number".
#   But than I found exactly the same read only 9 lines higher and after it the
#   line I expected the second one to be. Between the 2 pci_bus_read_config_byte's
#   are only some checks so I don't expect them to return different results. And
#   sec_no is and int so removing this wont change anything at all.
#   
#   
#   Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/pci/hotplug/ibmphp_pci.c
#   2005/02/07 12:52:07-08:00 eike-hotplug@sf-tec.de +0 -3
#   PCI Hotplug: Remove unneeded instructions from ibmphp_pci.c
# 
# ChangeSet
#   2005/02/07 14:37:01-08:00 davej@redhat.com 
#   [PATCH] Remove pci_dev->slot_name
#   
#   This is a pointer to dev.bus_id, which is properly accessed through the
#   pci_name() function.
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# include/linux/pci.h
#   2005/02/07 12:52:49-08:00 davej@redhat.com +0 -2
#   Remove pci_dev->slot_name
# 
# ChangeSet
#   2005/02/07 14:36:14-08:00 davej@redhat.com 
#   [PATCH] convert pci_dev->slot_name usage to pci_name()
#   
#   Prepare for removal of pci_dev->slot_name
#   
#   Signed-off-by: Dave Jones <davej@redhat.com>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/scsi/qla2xxx/qla_os.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +7 -7
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/pcmcia/yenta_socket.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/pci/setup-res.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/pci/probe.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +0 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/pci/pci.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/parisc/dino.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +2 -3
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/wan/wanxl.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +16 -22
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/via-velocity.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/typhoon.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/tulip/tulip.h
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/sk98lin/skge.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/sk98lin/skethtool.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/s2io.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/r8169.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +2 -2
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/net/defxx.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/media/video/zoran_driver.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/media/video/meye.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/media/common/saa7146_video.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/isdn/hisax/hisax_fcpcipnp.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/ide/pci/sgiioc4.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +3 -3
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/char/agp/sis-agp.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# drivers/char/agp/generic.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/sh64/kernel/pcibios.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +2 -2
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/sh64/kernel/pci_sh5.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/sh/drivers/pci/pci-st40.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/sh/drivers/pci/pci-sh7751.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +4 -4
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/sh/drivers/pci/fixups-sh03.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +2 -2
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/ppc/kernel/pci.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +1 -1
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/mips/pmc-sierra/yosemite/ht.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +3 -3
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/frv/mb93090-mb00/pci-vdk.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +3 -3
#   convert pci_dev->slot_name usage to pci_name()
# 
# arch/frv/mb93090-mb00/pci-frv.c
#   2005/02/07 12:52:54-08:00 davej@redhat.com +2 -2
#   convert pci_dev->slot_name usage to pci_name()
# 
diff -Nru a/Documentation/pci.txt b/Documentation/pci.txt
--- a/Documentation/pci.txt	2005-02-08 14:47:26 -08:00
+++ b/Documentation/pci.txt	2005-02-08 14:47:26 -08:00
@@ -99,10 +99,10 @@
 Users need pass only as many fields as necessary; vendor, device,
 subvendor, and subdevice fields default to PCI_ANY_ID (FFFFFFFF),
 class and classmask fields default to 0, and driver_data defaults to
-0UL.  Device drivers must call
-   pci_dynids_set_use_driver_data(pci_driver *, 1)
-in order for the driver_data field to get passed to the driver.
-Otherwise, only a 0 is passed in that field.
+0UL.  Device drivers must initialize use_driver_data in the dynids struct
+in their pci_driver struct prior to calling pci_register_driver in order
+for the driver_data field to get passed to the driver. Otherwise, only a
+0 is passed in that field.
 
 When the driver exits, it just calls pci_unregister_driver() and the PCI layer
 automatically calls the remove hook for all devices handled by the driver.
diff -Nru a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
--- a/arch/frv/mb93090-mb00/pci-frv.c	2005-02-08 14:47:26 -08:00
+++ b/arch/frv/mb93090-mb00/pci-frv.c	2005-02-08 14:47:26 -08:00
@@ -43,7 +43,7 @@
 	pci_read_config_dword(dev, reg, &check);
 	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
 		printk(KERN_ERR "PCI: Error while updating region "
-		       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+		       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
 		       new, check);
 	}
 }
@@ -128,7 +128,7 @@
 					continue;
 				pr = pci_find_parent_resource(dev, r);
 				if (!pr || request_resource(pr, r) < 0)
-					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, dev->slot_name);
+					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
 			}
 		}
 		pcibios_allocate_bus_resources(&bus->children);
diff -Nru a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
--- a/arch/frv/mb93090-mb00/pci-vdk.c	2005-02-08 14:47:26 -08:00
+++ b/arch/frv/mb93090-mb00/pci-vdk.c	2005-02-08 14:47:26 -08:00
@@ -294,7 +294,7 @@
 	 */
 	int i;
 
-	printk("PCI: Fixing base address flags for device %s\n", d->slot_name);
+	printk("PCI: Fixing base address flags for device %s\n", pci_name(d));
 	for(i=0; i<4; i++)
 		d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
 }
@@ -308,7 +308,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
@@ -326,7 +326,7 @@
 	 * There exist PCI IDE controllers which have utter garbage
 	 * in first four base registers. Ignore that.
 	 */
-	printk("PCI: IDE base address trash cleared for %s\n", d->slot_name);
+	printk("PCI: IDE base address trash cleared for %s\n", pci_name(d));
 	for(i=0; i<4; i++)
 		d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0;
 }
diff -Nru a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
--- a/arch/i386/pci/direct.c	2005-02-08 14:47:26 -08:00
+++ b/arch/i386/pci/direct.c	2005-02-08 14:47:26 -08:00
@@ -13,7 +13,8 @@
 #define PCI_CONF1_ADDRESS(bus, devfn, reg) \
 	(0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
 
-static int pci_conf1_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_conf1_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
@@ -41,7 +42,8 @@
 	return 0;
 }
 
-static int pci_conf1_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_conf1_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
@@ -83,7 +85,8 @@
 
 #define PCI_CONF2_ADDRESS(dev, reg)	(u16)(0xC000 | (dev << 8) | reg)
 
-static int pci_conf2_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_conf2_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 	int dev, fn;
@@ -121,7 +124,8 @@
 	return 0;
 }
 
-static int pci_conf2_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_conf2_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 	int dev, fn;
diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
--- a/arch/i386/pci/irq.c	2005-02-08 14:47:26 -08:00
+++ b/arch/i386/pci/irq.c	2005-02-08 14:47:26 -08:00
@@ -1031,56 +1031,55 @@
 
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
 	if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
-		char *msg;
-		msg = "";
+		char *msg = "";
+
+		pin--;		/* interrupt pins are numbered starting from 1 */
+
 		if (io_apic_assign_pci_irqs) {
 			int irq;
 
-			if (pin) {
-				pin--;		/* interrupt pins are numbered starting from 1 */
-				irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
-				/*
-				 * Busses behind bridges are typically not listed in the MP-table.
-				 * In this case we have to look up the IRQ based on the parent bus,
-				 * parent slot, and pin number. The SMP code detects such bridged
-				 * busses itself so we should get into this branch reliably.
-				 */
-				temp_dev = dev;
-				while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
-					struct pci_dev * bridge = dev->bus->self;
-
-					pin = (pin + PCI_SLOT(dev->devfn)) % 4;
-					irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 
-							PCI_SLOT(bridge->devfn), pin);
-					if (irq >= 0)
-						printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n",
-							pci_name(bridge), 'A' + pin, irq);
-					dev = bridge;
-				}
-				dev = temp_dev;
-				if (irq >= 0) {
+			irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
+			/*
+			 * Busses behind bridges are typically not listed in the MP-table.
+			 * In this case we have to look up the IRQ based on the parent bus,
+			 * parent slot, and pin number. The SMP code detects such bridged
+			 * busses itself so we should get into this branch reliably.
+			 */
+			temp_dev = dev;
+			while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
+				struct pci_dev * bridge = dev->bus->self;
+
+				pin = (pin + PCI_SLOT(dev->devfn)) % 4;
+				irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 
+						PCI_SLOT(bridge->devfn), pin);
+				if (irq >= 0)
+					printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n",
+						pci_name(bridge), 'A' + pin, irq);
+				dev = bridge;
+			}
+			dev = temp_dev;
+			if (irq >= 0) {
 #ifdef CONFIG_PCI_MSI
-					if (!platform_legacy_irq(irq))
-						irq = IO_APIC_VECTOR(irq);
+				if (!platform_legacy_irq(irq))
+					irq = IO_APIC_VECTOR(irq);
 #endif
-					printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n",
-						pci_name(dev), 'A' + pin, irq);
-					dev->irq = irq;
-					return 0;
-				} else
-					msg = " Probably buggy MP table.";
-			}
+				printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n",
+					pci_name(dev), 'A' + pin, irq);
+				dev->irq = irq;
+				return 0;
+			} else
+				msg = " Probably buggy MP table.";
 		} else if (pci_probe & PCI_BIOS_IRQ_SCAN)
 			msg = "";
 		else
 			msg = " Please try using pci=biosirq.";
-			
+
 		/* With IDE legacy devices the IRQ lookup failure is not a problem.. */
 		if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE && !(dev->class & 0x5))
 			return 0;
-			
+
 		printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n",
-		       'A' + pin - 1, pci_name(dev), msg);
+		       'A' + pin, pci_name(dev), msg);
 	}
 	/* VIA bridges use interrupt line for apic/pci steering across
 	   the V-Link */
diff -Nru a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
--- a/arch/i386/pci/mmconfig.c	2005-02-08 14:47:26 -08:00
+++ b/arch/i386/pci/mmconfig.c	2005-02-08 14:47:26 -08:00
@@ -34,7 +34,8 @@
 	}
 }
 
-static int pci_mmcfg_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
@@ -62,7 +63,8 @@
 	return 0;
 }
 
-static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
diff -Nru a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c
--- a/arch/i386/pci/numa.c	2005-02-08 14:47:26 -08:00
+++ b/arch/i386/pci/numa.c	2005-02-08 14:47:26 -08:00
@@ -14,11 +14,12 @@
 #define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \
 	(0x80000000 | (BUS2LOCAL(bus) << 16) | (devfn << 8) | (reg & ~3))
 
-static int pci_conf1_mq_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_conf1_mq_read(unsigned int seg, unsigned int bus,
+			     unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
-	if (!value || (bus > MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
+	if (!value || (bus >= MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
 		return -EINVAL;
 
 	spin_lock_irqsave(&pci_config_lock, flags);
@@ -42,11 +43,12 @@
 	return 0;
 }
 
-static int pci_conf1_mq_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_conf1_mq_write(unsigned int seg, unsigned int bus,
+			      unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
-	if ((bus > MAX_MP_BUSSES) || (devfn > 255) || (reg > 255)) 
+	if ((bus >= MAX_MP_BUSSES) || (devfn > 255) || (reg > 255)) 
 		return -EINVAL;
 
 	spin_lock_irqsave(&pci_config_lock, flags);
diff -Nru a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c
--- a/arch/i386/pci/pcbios.c	2005-02-08 14:47:26 -08:00
+++ b/arch/i386/pci/pcbios.c	2005-02-08 14:47:26 -08:00
@@ -172,7 +172,8 @@
 	return (int) (ret & 0xff00) >> 8;
 }
 
-static int pci_bios_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_bios_read(unsigned int seg, unsigned int bus,
+			 unsigned int devfn, int reg, int len, u32 *value)
 {
 	unsigned long result = 0;
 	unsigned long flags;
@@ -227,7 +228,8 @@
 	return (int)((result & 0xff00) >> 8);
 }
 
-static int pci_bios_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_bios_write(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 value)
 {
 	unsigned long result = 0;
 	unsigned long flags;
diff -Nru a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
--- a/arch/ia64/pci/pci.c	2005-02-08 14:47:26 -08:00
+++ b/arch/ia64/pci/pci.c	2005-02-08 14:47:26 -08:00
@@ -3,9 +3,9 @@
  *
  * Derived from bios32.c of i386 tree.
  *
- * Copyright (C) 2002 Hewlett-Packard Co
+ * (c) Copyright 2002, 2005 Hewlett-Packard Development Company, L.P.
  *	David Mosberger-Tang <davidm@hpl.hp.com>
- *	Bjorn Helgaas <bjorn_helgaas@hp.com>
+ *	Bjorn Helgaas <bjorn.helgaas@hp.com>
  * Copyright (C) 2004 Silicon Graphics, Inc.
  *
  * Note: Above list of copyright holders is incomplete...
@@ -27,26 +27,12 @@
 #include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/io.h>
-
 #include <asm/sal.h>
-
-
-#ifdef CONFIG_SMP
-# include <asm/smp.h>
-#endif
+#include <asm/smp.h>
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
 
 
-#undef DEBUG
-#define DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 static int pci_routeirq;
 
 /*
@@ -55,23 +41,22 @@
  * synchronization mechanism here.
  */
 
-#define PCI_SAL_ADDRESS(seg, bus, devfn, reg)	\
-	((u64)(seg << 24) | (u64)(bus << 16) |	\
-	 (u64)(devfn << 8) | (u64)(reg))
+#define PCI_SAL_ADDRESS(seg, bus, devfn, reg)		\
+	(((u64) seg << 24) | (bus << 16) | (devfn << 8) | (reg))
 
 /* SAL 3.2 adds support for extended config space. */
 
 #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg)	\
-	((u64)(seg << 28) | (u64)(bus << 20) |		\
-	 (u64)(devfn << 12) | (u64)(reg))
+	(((u64) seg << 28) | (bus << 20) | (devfn << 12) | (reg))
 
 static int
-pci_sal_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn,
+	      int reg, int len, u32 *value)
 {
-	u64 addr, mode, data = 0;
-	int result = 0;
+	u64 addr, data = 0;
+	int mode, result;
 
-	if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))
+	if (!value || (seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))
 		return -EINVAL;
 
 	if ((seg | reg) <= 255) {
@@ -82,16 +67,19 @@
 		mode = 1;
 	}
 	result = ia64_sal_pci_config_read(addr, mode, len, &data);
+	if (result != 0)
+		return -EINVAL;
 
 	*value = (u32) data;
-
-	return result;
+	return 0;
 }
 
 static int
-pci_sal_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn,
+	       int reg, int len, u32 value)
 {
-	u64 addr, mode;
+	u64 addr;
+	int mode, result;
 
 	if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))
 		return -EINVAL;
@@ -103,7 +91,10 @@
 		addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg);
 		mode = 1;
 	}
-	return ia64_sal_pci_config_write(addr, mode, len, value);
+	result = ia64_sal_pci_config_write(addr, mode, len, value);
+	if (result != 0)
+		return -EINVAL;
+	return 0;
 }
 
 static struct pci_raw_ops pci_sal_ops = {
diff -Nru a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c
--- a/arch/mips/pmc-sierra/yosemite/ht.c	2005-02-08 14:47:26 -08:00
+++ b/arch/mips/pmc-sierra/yosemite/ht.c	2005-02-08 14:47:26 -08:00
@@ -303,7 +303,7 @@
                 if (!r->start && r->end) {
                         printk(KERN_ERR
                                "PCI: Device %s not available because of "
-                               "resource collisions\n", dev->slot_name);
+                               "resource collisions\n", pci_name(dev));
                         return -EINVAL;
                 }
                 if (r->flags & IORESOURCE_IO)
@@ -377,7 +377,7 @@
             ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK :
              PCI_BASE_ADDRESS_MEM_MASK)) {
                 printk(KERN_ERR "PCI: Error while updating region "
-                       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+                       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
                        new, check);
         }
 }
@@ -396,7 +396,7 @@
                    addresses kilobyte aligned.  */
                 if (size > 0x100) {
                         printk(KERN_ERR "PCI: I/O Region %s/%d too large"
-                               " (%ld bytes)\n", dev->slot_name,
+                               " (%ld bytes)\n", pci_name(dev),
                                 dev->resource - res, size);
                 }
 
diff -Nru a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
--- a/arch/ppc/kernel/pci.c	2005-02-08 14:47:26 -08:00
+++ b/arch/ppc/kernel/pci.c	2005-02-08 14:47:26 -08:00
@@ -1058,7 +1058,7 @@
 		return;
  	res = *(bus->resource[0]);
 
-	DBG("Remapping Bus %d, bridge: %s\n", bus->number, bridge->slot_name);
+	DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
 	res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	DBG("  IO window: %08lx-%08lx\n", res.start, res.end);
diff -Nru a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
--- a/arch/ppc64/kernel/pci.c	2005-02-08 14:47:26 -08:00
+++ b/arch/ppc64/kernel/pci.c	2005-02-08 14:47:26 -08:00
@@ -300,19 +300,15 @@
 
 EXPORT_SYMBOL(pci_domain_nr);
 
-/* Set the name of the bus as it appears in /proc/bus/pci */
-int pci_name_bus(char *name, struct pci_bus *bus)
+/* Decide whether to display the domain number in /proc */
+int pci_proc_domain(struct pci_bus *bus)
 {
-#ifndef CONFIG_PPC_ISERIES
+#ifdef CONFIG_PPC_ISERIES
+	return 0;
+#else
 	struct pci_controller *hose = pci_bus_to_host(bus);
-
-	if (hose->buid)
-		sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
-	else
+	return hose->buid;
 #endif
-		sprintf(name, "%02x", bus->number);
-
-	return 0;
 }
 
 /*
diff -Nru a/arch/sh/drivers/pci/fixups-sh03.c b/arch/sh/drivers/pci/fixups-sh03.c
--- a/arch/sh/drivers/pci/fixups-sh03.c	2005-02-08 14:47:26 -08:00
+++ b/arch/sh/drivers/pci/fixups-sh03.c	2005-02-08 14:47:26 -08:00
@@ -46,11 +46,11 @@
 	/* now lookup the actual IRQ on a platform specific basis (pci-'platform'.c) */
 	irq = pcibios_map_platform_irq(slot, pin, dev);
 	if( irq < 0 ) {
-		pr_debug("PCI: Error mapping IRQ on device %s\n", dev->slot_name);
+		pr_debug("PCI: Error mapping IRQ on device %s\n", pci_name(dev));
 		return irq;
 	}
 
-	pr_debug("Setting IRQ for slot %s to %d\n", dev->slot_name, irq);
+	pr_debug("Setting IRQ for slot %s to %d\n", pci_name(dev), irq);
 
 	return irq;
 }
diff -Nru a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c
--- a/arch/sh/drivers/pci/pci-sh7751.c	2005-02-08 14:47:26 -08:00
+++ b/arch/sh/drivers/pci/pci-sh7751.c	2005-02-08 14:47:26 -08:00
@@ -169,7 +169,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	pr_debug("PCI: IDE base address fixup for %s\n", d->slot_name);
+	pr_debug("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
@@ -401,11 +401,11 @@
 	/* now lookup the actual IRQ on a platform specific basis (pci-'platform'.c) */
 	irq = pcibios_map_platform_irq(slot,pin);
 	if( irq < 0 ) {
-		pr_debug("PCI: Error mapping IRQ on device %s\n", dev->slot_name);
+		pr_debug("PCI: Error mapping IRQ on device %s\n", pci_name(dev));
 		return irq;
 	}
-	
-	pr_debug("Setting IRQ for slot %s to %d\n", dev->slot_name, irq);
+
+	pr_debug("Setting IRQ for slot %s to %d\n", pci_name(dev), irq);
 
 	return irq;
 }
diff -Nru a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c
--- a/arch/sh/drivers/pci/pci-st40.c	2005-02-08 14:47:26 -08:00
+++ b/arch/sh/drivers/pci/pci-st40.c	2005-02-08 14:47:26 -08:00
@@ -246,7 +246,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
diff -Nru a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c
--- a/arch/sh64/kernel/pci_sh5.c	2005-02-08 14:47:26 -08:00
+++ b/arch/sh64/kernel/pci_sh5.c	2005-02-08 14:47:26 -08:00
@@ -39,7 +39,7 @@
 	 */
 	if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE)
 		return;
-	printk("PCI: IDE base address fixup for %s\n", d->slot_name);
+	printk("PCI: IDE base address fixup for %s\n", pci_name(d));
 	for(i=0; i<4; i++) {
 		struct resource *r = &d->resource[i];
 		if ((r->start & ~0x80) == 0x374) {
diff -Nru a/arch/sh64/kernel/pcibios.c b/arch/sh64/kernel/pcibios.c
--- a/arch/sh64/kernel/pcibios.c	2005-02-08 14:47:26 -08:00
+++ b/arch/sh64/kernel/pcibios.c	2005-02-08 14:47:26 -08:00
@@ -57,7 +57,7 @@
 	pci_read_config_dword(dev, reg, &check);
 	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
 		printk(KERN_ERR "PCI: Error while updating region "
-		       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+		       "%s/%d (%08x != %08x)\n", pci_name(dev), resource,
 		       new, check);
 	}
 }
@@ -125,7 +125,7 @@
 			continue;
 		r = &dev->resource[idx];
 		if (!r->start && r->end) {
-			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
+			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
 			return -EINVAL;
 		}
 		if (r->flags & IORESOURCE_IO)
diff -Nru a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
--- a/arch/sparc64/kernel/pci.c	2005-02-08 14:47:25 -08:00
+++ b/arch/sparc64/kernel/pci.c	2005-02-08 14:47:25 -08:00
@@ -794,12 +794,6 @@
 }
 EXPORT_SYMBOL(pci_domain_nr);
 
-int pci_name_bus(char *name, struct pci_bus *bus)
-{
-	sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
-	return 0;
-}
-
 int pcibios_prep_mwi(struct pci_dev *dev)
 {
 	/* We set correct PCI_CACHE_LINE_SIZE register values for every
diff -Nru a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
--- a/arch/x86_64/pci/mmconfig.c	2005-02-08 14:47:26 -08:00
+++ b/arch/x86_64/pci/mmconfig.c	2005-02-08 14:47:26 -08:00
@@ -17,12 +17,13 @@
 /* Static virtual mapping of the MMCONFIG aperture */
 char *pci_mmcfg_virt;
 
-static inline char *pci_dev_base(int bus, int devfn)
+static inline char *pci_dev_base(unsigned int bus, unsigned int devfn)
 {
 	return pci_mmcfg_virt + ((bus << 20) | (devfn << 12));
 }
 
-static int pci_mmcfg_read(int seg, int bus, int devfn, int reg, int len, u32 *value)
+static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
+			  unsigned int devfn, int reg, int len, u32 *value)
 {
 	char *addr = pci_dev_base(bus, devfn); 
 
@@ -44,7 +45,8 @@
 	return 0;
 }
 
-static int pci_mmcfg_write(int seg, int bus, int devfn, int reg, int len, u32 value)
+static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
+			   unsigned int devfn, int reg, int len, u32 value)
 {
 	char *addr = pci_dev_base(bus,devfn);
 
diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
--- a/drivers/char/agp/generic.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/char/agp/generic.c	2005-02-08 14:47:26 -08:00
@@ -611,7 +611,7 @@
 	printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
 				agp_bridge->major_version,
 				agp_bridge->minor_version,
-				agp_bridge->dev->slot_name);
+				pci_name(agp_bridge->dev));
 
 	pci_read_config_dword(agp_bridge->dev,
 		      agp_bridge->capndx + PCI_AGP_STATUS, &command);
diff -Nru a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
--- a/drivers/char/agp/sis-agp.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/char/agp/sis-agp.c	2005-02-08 14:47:26 -08:00
@@ -79,7 +79,7 @@
 	printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
 		agp_bridge->major_version,
 		agp_bridge->minor_version,
-		agp_bridge->dev->slot_name);
+		pci_name(agp_bridge->dev));
 
 	pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command);
 	command = agp_collect_device_status(mode, command);
diff -Nru a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
--- a/drivers/ide/pci/sgiioc4.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/ide/pci/sgiioc4.c	2005-02-08 14:47:26 -08:00
@@ -688,7 +688,7 @@
 	if (ret < 0) {
 		printk(KERN_ERR
 		       "Failed to enable device %s at slot %s\n",
-		       d->name, dev->slot_name);
+		       d->name, pci_name(dev));
 		goto out;
 	}
 	pci_set_master(dev);
@@ -696,11 +696,11 @@
 	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
 	class_rev &= 0xff;
 	printk(KERN_INFO "%s: IDE controller at PCI slot %s, revision %d\n",
-			d->name, dev->slot_name, class_rev);
+			d->name, pci_name(dev), class_rev);
 	if (class_rev < IOC4_SUPPORTED_FIRMWARE_REV) {
 		printk(KERN_ERR "Skipping %s IDE controller in slot %s: "
 			"firmware is obsolete - please upgrade to revision"
-			"46 or higher\n", d->name, dev->slot_name);
+			"46 or higher\n", d->name, pci_name(dev));
 		ret = -EAGAIN;
 		goto out;
 	}
diff -Nru a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c	2005-02-08 14:47:26 -08:00
@@ -902,7 +902,7 @@
 	adapter->irq = pdev->irq;
 
 	printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
-	       (char *) ent->driver_data, pdev->slot_name);
+	       (char *) ent->driver_data, pci_name(pdev));
 
 	retval = fcpcipnp_setup(adapter);
 	if (retval)
diff -Nru a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
--- a/drivers/media/common/saa7146_video.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/media/common/saa7146_video.c	2005-02-08 14:47:26 -08:00
@@ -889,7 +889,7 @@
 		
                 strcpy(cap->driver, "saa7146 v4l2");
 		strlcpy(cap->card, dev->ext->name, sizeof(cap->card));
-		sprintf(cap->bus_info,"PCI:%s",dev->pci->slot_name);
+		sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
 		cap->version = SAA7146_VERSION_CODE;
 		cap->capabilities =
 			V4L2_CAP_VIDEO_CAPTURE |
diff -Nru a/drivers/media/video/meye.c b/drivers/media/video/meye.c
--- a/drivers/media/video/meye.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/media/video/meye.c	2005-02-08 14:47:26 -08:00
@@ -1154,7 +1154,7 @@
 		memset(cap, 0, sizeof(*cap));
 		strcpy(cap->driver, "meye");
 		strcpy(cap->card, "meye");
-		sprintf(cap->bus_info, "PCI:%s", meye.mchip_dev->slot_name);
+		sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev));
 		cap->version = (MEYE_DRIVER_MAJORVERSION << 8) +
 			       MEYE_DRIVER_MINORVERSION;
 		cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
diff -Nru a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
--- a/drivers/media/video/zoran_driver.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/media/video/zoran_driver.c	2005-02-08 14:47:26 -08:00
@@ -2694,7 +2694,7 @@
 		strncpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card));
 		strncpy(cap->driver, "zoran", sizeof(cap->driver));
 		snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
-			 zr->pci_dev->slot_name);
+			 pci_name(zr->pci_dev));
 		cap->version =
 		    KERNEL_VERSION(MAJOR_VERSION, MINOR_VERSION,
 				   RELEASE_VERSION);
diff -Nru a/drivers/net/defxx.c b/drivers/net/defxx.c
--- a/drivers/net/defxx.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/defxx.c	2005-02-08 14:47:26 -08:00
@@ -420,7 +420,7 @@
 	}
 
 	if (pdev != NULL)
-		print_name = pdev->slot_name;
+		print_name = pci_name(pdev);
 
 	dev = alloc_fddidev(sizeof(*bp));
 	if (!dev) {
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
--- a/drivers/net/r8169.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/r8169.c	2005-02-08 14:47:26 -08:00
@@ -1146,7 +1146,7 @@
 	// enable device (incl. PCI PM wakeup and hotplug setup)
 	rc = pci_enable_device(pdev);
 	if (rc) {
-		printk(KERN_ERR PFX "%s: enable failure\n", pdev->slot_name);
+		printk(KERN_ERR PFX "%s: enable failure\n", pci_name(pdev));
 		goto err_out_free_dev;
 	}
 
@@ -1184,7 +1184,7 @@
 	rc = pci_request_regions(pdev, MODULENAME);
 	if (rc) {
 		printk(KERN_ERR PFX "%s: could not request regions.\n",
-		       pdev->slot_name);
+		       pci_name(pdev));
 		goto err_out_mwi;
 	}
 
diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c
--- a/drivers/net/s2io.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/s2io.c	2005-02-08 14:47:26 -08:00
@@ -3192,7 +3192,7 @@
 	strncpy(info->version, s2io_driver_version,
 		sizeof(s2io_driver_version));
 	strncpy(info->fw_version, "", 32);
-	strncpy(info->bus_info, sp->pdev->slot_name, 32);
+	strncpy(info->bus_info, pci_name(sp->pdev), 32);
 	info->regdump_len = XENA_REG_SPACE;
 	info->eedump_len = XENA_EEPROM_SPACE;
 	info->testinfo_len = S2IO_TEST_LEN;
diff -Nru a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c
--- a/drivers/net/sk98lin/skethtool.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/sk98lin/skethtool.c	2005-02-08 14:47:26 -08:00
@@ -257,7 +257,7 @@
 	strlcpy(info->driver, DRIVER_FILE_NAME, sizeof(info->driver));
 	strcpy(info->version, vers);
 	strcpy(info->fw_version, "N/A");
-	strlcpy(info->bus_info, pAC->PciDev->slot_name, ETHTOOL_BUSINFO_LEN);
+	strlcpy(info->bus_info, pci_name(pAC->PciDev), ETHTOOL_BUSINFO_LEN);
 }
 
 /*
diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
--- a/drivers/net/sk98lin/skge.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/sk98lin/skge.c	2005-02-08 14:47:26 -08:00
@@ -3058,7 +3058,7 @@
 		*/
 		* ((SK_U32 *)pMemBuf) = 0;
 		* ((SK_U32 *)pMemBuf + 1) = pdev->bus->number;
-		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pdev->slot_name);
+		* ((SK_U32 *)pMemBuf + 2) = ParseDeviceNbrFromSlotName(pci_name(pdev));
 		if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
 			Err = -EFAULT;
 			goto fault_diag;
diff -Nru a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
--- a/drivers/net/tulip/tulip.h	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/tulip/tulip.h	2005-02-08 14:47:26 -08:00
@@ -476,7 +476,7 @@
 
 		if (!i)
 			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
-					tp->pdev->slot_name);
+					pci_name(tp->pdev));
 	}
 }
 
diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c
--- a/drivers/net/typhoon.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/typhoon.c	2005-02-08 14:47:26 -08:00
@@ -2438,7 +2438,7 @@
 	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
 	if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
 		printk(ERR_PFX "%s: Could not get Sleep Image version\n",
-			pdev->slot_name);
+			pci_name(pdev));
 		goto error_out_reset;
 	}
 
diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/via-velocity.c	2005-02-08 14:47:26 -08:00
@@ -2898,7 +2898,7 @@
 	struct velocity_info *vptr = dev->priv;
 	strcpy(info->driver, VELOCITY_NAME);
 	strcpy(info->version, VELOCITY_VERSION);
-	strcpy(info->bus_info, vptr->pdev->slot_name);
+	strcpy(info->bus_info, pci_name(vptr->pdev));
 }
 
 static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
diff -Nru a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
--- a/drivers/net/wan/wanxl.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/net/wan/wanxl.c	2005-02-08 14:47:26 -08:00
@@ -72,7 +72,7 @@
 	u8 irq;
 
 	u8 __iomem *plx;	/* PLX PCI9060 virtual base address */
-	struct pci_dev *pdev;	/* for pdev->slot_name */
+	struct pci_dev *pdev;	/* for pci_name(pdev) */
 	int rx_in;
 	struct sk_buff *rx_skbs[RX_QUEUE_LENGTH];
 	card_status_t *status;	/* shared between host and card */
@@ -88,12 +88,6 @@
 }
 
 
-static inline const char* card_name(struct pci_dev *pdev)
-{
-	return pdev->slot_name;
-}
-
-
 static inline port_status_t* get_status(port_t *port)
 {
 	return &port->card->status->port_status[port->node];
@@ -107,7 +101,7 @@
 	dma_addr_t addr = pci_map_single(pdev, ptr, size, direction);
 	if (addr + size > 0x100000000LL)
 		printk(KERN_CRIT "wanXL %s: pci_map_single() returned memory"
-		       " at 0x%LX!\n", card_name(pdev),
+		       " at 0x%LX!\n", pci_name(pdev),
 		       (unsigned long long)addr);
 	return addr;
 }
@@ -201,7 +195,7 @@
 	       desc->stat != PACKET_EMPTY) {
 		if ((desc->stat & PACKET_PORT_MASK) > card->n_ports)
 			printk(KERN_CRIT "wanXL %s: received packet for"
-			       " nonexistent port\n", card_name(card->pdev));
+			       " nonexistent port\n", pci_name(card->pdev));
 		else {
 			struct sk_buff *skb = card->rx_skbs[card->rx_in];
 			port_t *port = &card->ports[desc->stat &
@@ -604,7 +598,7 @@
 	card = kmalloc(alloc_size, GFP_KERNEL);
 	if (card == NULL) {
 		printk(KERN_ERR "wanXL %s: unable to allocate memory\n",
-		       card_name(pdev));
+		       pci_name(pdev));
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
 		return -ENOBUFS;
@@ -623,7 +617,7 @@
 
 #ifdef DEBUG_PCI
 	printk(KERN_DEBUG "wanXL %s: pci_alloc_consistent() returned memory"
-	       " at 0x%LX\n", card_name(pdev),
+	       " at 0x%LX\n", pci_name(pdev),
 	       (unsigned long long)card->status_address);
 #endif
 
@@ -649,7 +643,7 @@
 	while ((stat = readl(card->plx + PLX_MAILBOX_0)) != 0) {
 		if (time_before(timeout, jiffies)) {
 			printk(KERN_WARNING "wanXL %s: timeout waiting for"
-			       " PUTS to complete\n", card_name(pdev));
+			       " PUTS to complete\n", pci_name(pdev));
 			wanxl_pci_remove_one(pdev);
 			return -ENODEV;
 		}
@@ -661,7 +655,7 @@
 
 		default:
 			printk(KERN_WARNING "wanXL %s: PUTS test 0x%X"
-			       " failed\n", card_name(pdev), stat & 0x30);
+			       " failed\n", pci_name(pdev), stat & 0x30);
 			wanxl_pci_remove_one(pdev);
 			return -ENODEV;
 		}
@@ -681,7 +675,7 @@
 	    (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) {
 		printk(KERN_WARNING "wanXL %s: no enough on-board RAM"
 		       " (%u bytes detected, %u bytes required)\n",
-		       card_name(pdev), ramsize, BUFFERS_ADDR +
+		       pci_name(pdev), ramsize, BUFFERS_ADDR +
 		       (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports);
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
@@ -689,7 +683,7 @@
 
 	if (wanxl_puts_command(card, MBX1_CMD_BSWAP)) {
 		printk(KERN_WARNING "wanXL %s: unable to Set Byte Swap"
-		       " Mode\n", card_name(pdev));
+		       " Mode\n", pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -720,7 +714,7 @@
 
 	if (wanxl_puts_command(card, MBX1_CMD_ABORTJ)) {
 		printk(KERN_WARNING "wanXL %s: unable to Abort and Jump\n",
-		       card_name(pdev));
+		       pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -735,7 +729,7 @@
 
 	if (!stat) {
 		printk(KERN_WARNING "wanXL %s: timeout while initializing card"
-		       "firmware\n", card_name(pdev));
+		       "firmware\n", pci_name(pdev));
 		wanxl_pci_remove_one(pdev);
 		return -ENODEV;
 	}
@@ -745,12 +739,12 @@
 #endif
 
 	printk(KERN_INFO "wanXL %s: at 0x%X, %u KB of RAM at 0x%X, irq %u\n",
-	       card_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
+	       pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
 
 	/* Allocate IRQ */
 	if (request_irq(pdev->irq, wanxl_intr, SA_SHIRQ, "wanXL", card)) {
 		printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
-		       card_name(pdev), pdev->irq);
+		       pci_name(pdev), pdev->irq);
 		wanxl_pci_remove_one(pdev);
 		return -EBUSY;
 	}
@@ -762,7 +756,7 @@
 		struct net_device *dev = alloc_hdlcdev(port);
 		if (!dev) {
 			printk(KERN_ERR "wanXL %s: unable to allocate"
-			       " memory\n", card_name(pdev));
+			       " memory\n", pci_name(pdev));
 			wanxl_pci_remove_one(pdev);
 			return -ENOMEM;
 		}
@@ -783,7 +777,7 @@
 		get_status(port)->clocking = CLOCK_EXT;
 		if (register_hdlc_device(dev)) {
 			printk(KERN_ERR "wanXL %s: unable to register hdlc"
-			       " device\n", card_name(pdev));
+			       " device\n", pci_name(pdev));
 			free_netdev(dev);
 			wanxl_pci_remove_one(pdev);
 			return -ENOBUFS;
@@ -791,7 +785,7 @@
 		card->n_ports++;
 	}
 
-	printk(KERN_INFO "wanXL %s: port", card_name(pdev));
+	printk(KERN_INFO "wanXL %s: port", pci_name(pdev));
 	for (i = 0; i < ports; i++)
 		printk("%s #%i: %s", i ? "," : "", i,
 		       card->ports[i].dev->name);
diff -Nru a/drivers/parisc/dino.c b/drivers/parisc/dino.c
--- a/drivers/parisc/dino.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/parisc/dino.c	2005-02-08 14:47:26 -08:00
@@ -653,14 +653,13 @@
 				      PCI_INTERRUPT_PIN, 1, &irq_pin);
 			irq_pin = (irq_pin + PCI_SLOT(dev->devfn) - 1) % 4 ;
 			printk(KERN_WARNING "Device %s has undefined IRQ, "
-					"setting to %d\n", dev->slot_name,
-					irq_pin);
+					"setting to %d\n", pci_name(dev), irq_pin);
 			dino_cfg_write(dev->bus, dev->devfn, 
 				       PCI_INTERRUPT_LINE, 1, irq_pin);
 			dino_assign_irq(dino_dev, irq_pin, &dev->irq);
 #else
 			dev->irq = 65535;
-			printk(KERN_WARNING "Device %s has unassigned IRQ\n", dev->slot_name);	
+			printk(KERN_WARNING "Device %s has unassigned IRQ\n", pci_name(dev));
 #endif
 		} else {
 
diff -Nru a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
--- a/drivers/pci/hotplug/ibmphp_pci.c	2005-02-08 14:47:25 -08:00
+++ b/drivers/pci/hotplug/ibmphp_pci.c	2005-02-08 14:47:25 -08:00
@@ -1384,9 +1384,6 @@
 		return -EINVAL;
 	}
 
-	pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
-	sec_no = (int) sec_no;
-
 	pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SUBORDINATE_BUS, &sub_number);
 	sub_no = (int) sub_number;
 	debug ("sub_no is %d, sec_no is %d\n", sub_no, sec_no);
diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/pci/pci-driver.c	2005-02-08 14:47:26 -08:00
@@ -115,7 +115,6 @@
 static inline void
 pci_init_dynids(struct pci_dynids *dynids)
 {
-	memset(dynids, 0, sizeof(*dynids));
 	spin_lock_init(&dynids->lock);
 	INIT_LIST_HEAD(&dynids->list);
 }
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/pci/pci.c	2005-02-08 14:47:26 -08:00
@@ -271,7 +271,7 @@
 	if ((pmc & PCI_PM_CAP_VER_MASK) != 2) {
 		printk(KERN_DEBUG
 		       "PCI: %s has unsupported PM cap regs version (%u)\n",
-		       dev->slot_name, pmc & PCI_PM_CAP_VER_MASK);
+		       pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);
 		return -EIO;
 	}
 
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/pci/probe.c	2005-02-08 14:47:26 -08:00
@@ -64,9 +64,11 @@
 
 void pci_remove_legacy_files(struct pci_bus *b)
 {
-	class_device_remove_bin_file(&b->class_dev, b->legacy_io);
-	class_device_remove_bin_file(&b->class_dev, b->legacy_mem);
-	kfree(b->legacy_io); /* both are allocated here */
+	if (b->legacy_io) {
+		class_device_remove_bin_file(&b->class_dev, b->legacy_io);
+		class_device_remove_bin_file(&b->class_dev, b->legacy_mem);
+		kfree(b->legacy_io); /* both are allocated here */
+	}
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }
@@ -549,7 +551,6 @@
 {
 	u32 class;
 
-	dev->slot_name = dev->dev.bus_id;
 	sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
 		dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
 
diff -Nru a/drivers/pci/proc.c b/drivers/pci/proc.c
--- a/drivers/pci/proc.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/pci/proc.c	2005-02-08 14:47:26 -08:00
@@ -384,26 +384,32 @@
 int pci_proc_attach_device(struct pci_dev *dev)
 {
 	struct pci_bus *bus = dev->bus;
-	struct proc_dir_entry *de, *e;
+	struct proc_dir_entry *e;
 	char name[16];
 
 	if (!proc_initialized)
 		return -EACCES;
 
-	if (!(de = bus->procdir)) {
-		if (pci_name_bus(name, bus))
-			return -EEXIST;
-		de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
-		if (!de)
+	if (!bus->procdir) {
+		if (pci_proc_domain(bus)) {
+			sprintf(name, "%04x:%02x", pci_domain_nr(bus),
+					bus->number);
+		} else {
+			sprintf(name, "%02x", bus->number);
+		}
+		bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
+		if (!bus->procdir)
 			return -ENOMEM;
 	}
+
 	sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-	e = dev->procent = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, de);
+	e = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir);
 	if (!e)
 		return -ENOMEM;
 	e->proc_fops = &proc_bus_pci_operations;
 	e->data = dev;
 	e->size = dev->cfg_size;
+	dev->procent = e;
 
 	return 0;
 }
diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/pci/setup-res.c	2005-02-08 14:47:26 -08:00
@@ -86,11 +86,11 @@
 	}
 	res->flags &= ~IORESOURCE_UNSET;
 	DBGC((KERN_INFO "PCI: moved device %s resource %d (%lx) to %x\n",
-		dev->slot_name, resno, res->flags,
+		pci_name(dev), resno, res->flags,
 		new & ~PCI_REGION_FLAG_MASK));
 }
 
-int __init
+int __devinit
 pci_claim_resource(struct pci_dev *dev, int resource)
 {
 	struct resource *res = &dev->resource[resource];
diff -Nru a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
--- a/drivers/pcmcia/yenta_socket.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/pcmcia/yenta_socket.c	2005-02-08 14:47:26 -08:00
@@ -963,7 +963,7 @@
 	 * the irq stuff...
 	 */
 	printk(KERN_INFO "Yenta: CardBus bridge found at %s [%04x:%04x]\n",
-		dev->slot_name, dev->subsystem_vendor, dev->subsystem_device);
+		pci_name(dev), dev->subsystem_vendor, dev->subsystem_device);
 
 	yenta_config_init(socket);
 
diff -Nru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
--- a/drivers/scsi/qla2xxx/qla_os.c	2005-02-08 14:47:26 -08:00
+++ b/drivers/scsi/qla2xxx/qla_os.c	2005-02-08 14:47:26 -08:00
@@ -1847,13 +1847,13 @@
 		if (pio_len < MIN_IOBASE_LEN) {
 			qla_printk(KERN_WARNING, ha,
 			    "Invalid PCI I/O region size (%s)...\n",
-			    ha->pdev->slot_name);
+				pci_name(ha->pdev));
 			pio = 0;
 		}
 	} else {
 		qla_printk(KERN_WARNING, ha,
 		    "region #0 not a PIO resource (%s)...\n",
-		    ha->pdev->slot_name);
+		    pci_name(ha->pdev));
 		pio = 0;
 	}
 
@@ -1865,20 +1865,20 @@
 	if (!(mmio_flags & IORESOURCE_MEM)) {
 		qla_printk(KERN_ERR, ha,
 		    "region #0 not an MMIO resource (%s), aborting\n",
-		    ha->pdev->slot_name);
+		    pci_name(ha->pdev));
 		goto iospace_error_exit;
 	}
 	if (mmio_len < MIN_IOBASE_LEN) {
 		qla_printk(KERN_ERR, ha,
 		    "Invalid PCI mem region size (%s), aborting\n",
-		    ha->pdev->slot_name);
+			pci_name(ha->pdev));
 		goto iospace_error_exit;
 	}
 
 	if (pci_request_regions(ha->pdev, ha->brd_info->drv_name)) {
 		qla_printk(KERN_WARNING, ha,
-		    "Failed to reserve PIO/MMIO regions (%s)\n", 
-		    ha->pdev->slot_name);
+		    "Failed to reserve PIO/MMIO regions (%s)\n",
+		    pci_name(ha->pdev));
 
 		goto iospace_error_exit;
 	}
@@ -1888,7 +1888,7 @@
 	ha->iobase = ioremap(mmio, MIN_IOBASE_LEN);
 	if (!ha->iobase) {
 		qla_printk(KERN_ERR, ha,
-		    "cannot remap MMIO (%s), aborting\n", ha->pdev->slot_name);
+		    "cannot remap MMIO (%s), aborting\n", pci_name(ha->pdev));
 
 		goto iospace_error_exit;
 	}
diff -Nru a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
--- a/include/asm-alpha/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/asm-alpha/pci.h	2005-02-08 14:47:26 -08:00
@@ -228,17 +228,10 @@
 
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
-static inline int
-pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
 	struct pci_controller *hose = bus->sysdata;
-
-	if (likely(hose->need_domain_info == 0)) {
-		sprintf(name, "%02x", bus->number);
-	} else {
-		sprintf(name, "%04x:%02x", hose->index, bus->number);
-	}
-	return 0;
+	return hose->need_domain_info;
 }
 
 static inline void
diff -Nru a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
--- a/include/asm-ia64/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/asm-ia64/pci.h	2005-02-08 14:47:26 -08:00
@@ -121,14 +121,9 @@
 
 extern struct pci_ops pci_root_ops;
 
-static inline int pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
-	if (pci_domain_nr(bus) == 0) {
-		sprintf(name, "%02x", bus->number);
-	} else {
-		sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
-	}
-	return 0;
+	return (pci_domain_nr(bus) != 0);
 }
 
 static inline void pcibios_add_platform_entries(struct pci_dev *dev)
diff -Nru a/include/asm-mips/pci.h b/include/asm-mips/pci.h
--- a/include/asm-mips/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/asm-mips/pci.h	2005-02-08 14:47:26 -08:00
@@ -137,17 +137,10 @@
 
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
-static inline int
-pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
 	struct pci_controller *hose = bus->sysdata;
-
-	if (likely(hose->need_domain_info == 0)) {
-		sprintf(name, "%02x", bus->number);
-	} else {
-		sprintf(name, "%04x:%02x", hose->index, bus->number);
-	}
-	return 0;
+	return hose->need_domain_info;
 }
 
 #endif /* CONFIG_PCI_DOMAINS */
diff -Nru a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
--- a/include/asm-ppc/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/asm-ppc/pci.h	2005-02-08 14:47:26 -08:00
@@ -79,9 +79,8 @@
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
 /* Set the name of the bus as it appears in /proc/bus/pci */
-static inline int pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
-	sprintf(name, "%02x", bus->number);
 	return 0;
 }
 
diff -Nru a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
--- a/include/asm-ppc64/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/asm-ppc64/pci.h	2005-02-08 14:47:26 -08:00
@@ -190,8 +190,8 @@
 
 extern int pci_domain_nr(struct pci_bus *bus);
 
-/* Set the name of the bus as it appears in /proc/bus/pci */
-extern int pci_name_bus(char *name, struct pci_bus *bus);
+/* Decide whether to display the domain number in /proc */
+extern int pci_proc_domain(struct pci_bus *bus);
 
 struct vm_area_struct;
 /* Map a range of PCI memory or I/O space for a device into user space */
diff -Nru a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
--- a/include/asm-sparc64/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/asm-sparc64/pci.h	2005-02-08 14:47:26 -08:00
@@ -223,7 +223,10 @@
 /* Return the index of the PCI controller for device PDEV. */
 
 extern int pci_domain_nr(struct pci_bus *bus);
-extern int pci_name_bus(char *name, struct pci_bus *bus);
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+	return 1;
+}
 
 /* Platform support for /proc/bus/pci/X/Y mmap()s. */
 
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	2005-02-08 14:47:26 -08:00
+++ b/include/linux/pci.h	2005-02-08 14:47:26 -08:00
@@ -549,8 +549,6 @@
 	unsigned int	irq;
 	struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
 
-	char *		slot_name;	/* pointer to dev.bus_id */
-
 	/* These fields are used by common fixups */
 	unsigned int	transparent:1;	/* Transparent PCI bridge */
 	unsigned int	multifunction:1;/* Part of multi-function device */
@@ -642,8 +640,10 @@
 };
 
 struct pci_raw_ops {
-	int (*read)(int dom, int bus, int devfn, int reg, int len, u32 *val);
-	int (*write)(int dom, int bus, int devfn, int reg, int len, u32 val);
+	int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn,
+		    int reg, int len, u32 *val);
+	int (*write)(unsigned int domain, unsigned int bus, unsigned int devfn,
+		     int reg, int len, u32 val);
 };
 
 extern struct pci_raw_ops *raw_pci_ops;
@@ -966,9 +966,8 @@
  */
 #ifndef CONFIG_PCI_DOMAINS
 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
-static inline int pci_name_bus(char *name, struct pci_bus *bus)
+static inline int pci_proc_domain(struct pci_bus *bus)
 {
-	sprintf(name, "%02x", bus->number);
 	return 0;
 }
 #endif
