git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git]
/
arch
/
powerpc
/
kernel
/
pci_dn.c
diff --git
a/arch/powerpc/kernel/pci_dn.c
b/arch/powerpc/kernel/pci_dn.c
index
12c4c9e
..
68df018
100644
(file)
--- a/
arch/powerpc/kernel/pci_dn.c
+++ b/
arch/powerpc/kernel/pci_dn.c
@@
-31,6
+31,7
@@
#include <asm/pci-bridge.h>
#include <asm/pSeries_reconfig.h>
#include <asm/ppc-pci.h>
#include <asm/pci-bridge.h>
#include <asm/pSeries_reconfig.h>
#include <asm/ppc-pci.h>
+#include <asm/firmware.h>
/*
* Traverse_func that inits the PCI fields of the device node.
/*
* Traverse_func that inits the PCI fields of the device node.
@@
-39,8
+40,8
@@
static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
{
struct pci_controller *phb = data;
static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
{
struct pci_controller *phb = data;
-
int *type = (int *)
get_property(dn, "ibm,pci-config-space-type", NULL);
- u32 *regs;
+
const int *type =
get_property(dn, "ibm,pci-config-space-type", NULL);
+
const
u32 *regs;
struct pci_dn *pdn;
if (mem_init_done)
struct pci_dn *pdn;
if (mem_init_done)
@@
-53,12
+54,17
@@
static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
dn->data = pdn;
pdn->node = dn;
pdn->phb = phb;
dn->data = pdn;
pdn->node = dn;
pdn->phb = phb;
- regs =
(u32 *)
get_property(dn, "reg", NULL);
+ regs = get_property(dn, "reg", NULL);
if (regs) {
/* First register entry is addr (00BBSS00) */
pdn->busno = (regs[0] >> 16) & 0xff;
pdn->devfn = (regs[0] >> 8) & 0xff;
}
if (regs) {
/* First register entry is addr (00BBSS00) */
pdn->busno = (regs[0] >> 16) & 0xff;
pdn->devfn = (regs[0] >> 8) & 0xff;
}
+ if (firmware_has_feature(FW_FEATURE_ISERIES)) {
+ const u32 *busp = get_property(dn, "linux,subbus", NULL);
+ if (busp)
+ pdn->bussubno = *busp;
+ }
pdn->pci_ext_config_space = (type && *type == 1);
return NULL;
pdn->pci_ext_config_space = (type && *type == 1);
return NULL;
@@
-90,10
+96,11
@@
void *traverse_pci_devices(struct device_node *start, traverse_func pre,
/* We started with a phb, iterate all childs */
for (dn = start->child; dn; dn = nextdn) {
/* We started with a phb, iterate all childs */
for (dn = start->child; dn; dn = nextdn) {
- u32 *classp, class;
+ const u32 *classp;
+ u32 class;
nextdn = NULL;
nextdn = NULL;
- classp =
(u32 *)
get_property(dn, "class-code", NULL);
+ classp = get_property(dn, "class-code", NULL);
class = classp ? *classp : 0;
if (pre && ((ret = pre(dn, data)) != NULL))
class = classp ? *classp : 0;
if (pre && ((ret = pre(dn, data)) != NULL))