diff options
Diffstat (limited to 'arch/powerpc/kernel/pci_dn.c')
-rw-r--r-- | arch/powerpc/kernel/pci_dn.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 1c18953514c3..68df018dae0e 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c | |||
@@ -40,8 +40,8 @@ | |||
40 | static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) | 40 | static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) |
41 | { | 41 | { |
42 | struct pci_controller *phb = data; | 42 | struct pci_controller *phb = data; |
43 | int *type = (int *)get_property(dn, "ibm,pci-config-space-type", NULL); | 43 | const int *type = get_property(dn, "ibm,pci-config-space-type", NULL); |
44 | u32 *regs; | 44 | const u32 *regs; |
45 | struct pci_dn *pdn; | 45 | struct pci_dn *pdn; |
46 | 46 | ||
47 | if (mem_init_done) | 47 | if (mem_init_done) |
@@ -54,14 +54,14 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) | |||
54 | dn->data = pdn; | 54 | dn->data = pdn; |
55 | pdn->node = dn; | 55 | pdn->node = dn; |
56 | pdn->phb = phb; | 56 | pdn->phb = phb; |
57 | regs = (u32 *)get_property(dn, "reg", NULL); | 57 | regs = get_property(dn, "reg", NULL); |
58 | if (regs) { | 58 | if (regs) { |
59 | /* First register entry is addr (00BBSS00) */ | 59 | /* First register entry is addr (00BBSS00) */ |
60 | pdn->busno = (regs[0] >> 16) & 0xff; | 60 | pdn->busno = (regs[0] >> 16) & 0xff; |
61 | pdn->devfn = (regs[0] >> 8) & 0xff; | 61 | pdn->devfn = (regs[0] >> 8) & 0xff; |
62 | } | 62 | } |
63 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { | 63 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { |
64 | u32 *busp = (u32 *)get_property(dn, "linux,subbus", NULL); | 64 | const u32 *busp = get_property(dn, "linux,subbus", NULL); |
65 | if (busp) | 65 | if (busp) |
66 | pdn->bussubno = *busp; | 66 | pdn->bussubno = *busp; |
67 | } | 67 | } |
@@ -96,10 +96,11 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, | |||
96 | 96 | ||
97 | /* We started with a phb, iterate all childs */ | 97 | /* We started with a phb, iterate all childs */ |
98 | for (dn = start->child; dn; dn = nextdn) { | 98 | for (dn = start->child; dn; dn = nextdn) { |
99 | u32 *classp, class; | 99 | const u32 *classp; |
100 | u32 class; | ||
100 | 101 | ||
101 | nextdn = NULL; | 102 | nextdn = NULL; |
102 | classp = (u32 *)get_property(dn, "class-code", NULL); | 103 | classp = get_property(dn, "class-code", NULL); |
103 | class = classp ? *classp : 0; | 104 | class = classp ? *classp : 0; |
104 | 105 | ||
105 | if (pre && ((ret = pre(dn, data)) != NULL)) | 106 | if (pre && ((ret = pre(dn, data)) != NULL)) |