[POWERPC] Use global_number in ppc32 pci_controller
[safe/jmp/linux-2.6] / arch / powerpc / kernel / pci-common.c
1 /*
2  * Contains common pci routines for ALL ppc platform
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version
7  * 2 of the License, or (at your option) any later version.
8  */
9
10 #undef DEBUG
11
12 #include <linux/kernel.h>
13 #include <linux/pci.h>
14 #include <linux/string.h>
15 #include <linux/init.h>
16 #include <linux/bootmem.h>
17 #include <linux/mm.h>
18 #include <linux/list.h>
19 #include <linux/syscalls.h>
20 #include <linux/irq.h>
21 #include <linux/vmalloc.h>
22
23 #include <asm/processor.h>
24 #include <asm/io.h>
25 #include <asm/prom.h>
26 #include <asm/pci-bridge.h>
27 #include <asm/byteorder.h>
28 #include <asm/machdep.h>
29 #include <asm/ppc-pci.h>
30 #include <asm/firmware.h>
31
32 #ifdef DEBUG
33 #include <asm/udbg.h>
34 #define DBG(fmt...) printk(fmt)
35 #else
36 #define DBG(fmt...)
37 #endif
38
39 /*
40  * Return the domain number for this bus.
41  */
42 int pci_domain_nr(struct pci_bus *bus)
43 {
44         if (firmware_has_feature(FW_FEATURE_ISERIES))
45                 return 0;
46         else {
47                 struct pci_controller *hose = pci_bus_to_host(bus);
48
49                 return hose->global_number;
50         }
51 }
52
53 EXPORT_SYMBOL(pci_domain_nr);