@@ -116,7 +116,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
116
116
struct pci_bus * bus ;
117
117
struct pci_dev * dev ;
118
118
int idx ;
119
- struct resource * r , * pr ;
119
+ struct resource * r ;
120
120
121
121
/* Depth-First Search on bus tree */
122
122
list_for_each_entry (bus , bus_list , node ) {
@@ -126,9 +126,8 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
126
126
r = & dev -> resource [idx ];
127
127
if (!r -> flags )
128
128
continue ;
129
- pr = pci_find_parent_resource (dev , r );
130
- if (!r -> start || !pr ||
131
- request_resource (pr , r ) < 0 ) {
129
+ if (!r -> start ||
130
+ pci_claim_resource (dev , idx ) < 0 ) {
132
131
dev_info (& dev -> dev , "BAR %d: can't allocate resource\n" , idx );
133
132
/*
134
133
* Something is wrong with the region.
@@ -149,7 +148,7 @@ static void __init pcibios_allocate_resources(int pass)
149
148
struct pci_dev * dev = NULL ;
150
149
int idx , disabled ;
151
150
u16 command ;
152
- struct resource * r , * pr ;
151
+ struct resource * r ;
153
152
154
153
for_each_pci_dev (dev ) {
155
154
pci_read_config_word (dev , PCI_COMMAND , & command );
@@ -168,8 +167,7 @@ static void __init pcibios_allocate_resources(int pass)
168
167
(unsigned long long ) r -> start ,
169
168
(unsigned long long ) r -> end ,
170
169
r -> flags , disabled , pass );
171
- pr = pci_find_parent_resource (dev , r );
172
- if (!pr || request_resource (pr , r ) < 0 ) {
170
+ if (pci_claim_resource (dev , idx ) < 0 ) {
173
171
dev_info (& dev -> dev , "BAR %d: can't allocate resource\n" , idx );
174
172
/* We'll assign a new address later */
175
173
r -> end -= r -> start ;
@@ -197,7 +195,7 @@ static void __init pcibios_allocate_resources(int pass)
197
195
static int __init pcibios_assign_resources (void )
198
196
{
199
197
struct pci_dev * dev = NULL ;
200
- struct resource * r , * pr ;
198
+ struct resource * r ;
201
199
202
200
if (!(pci_probe & PCI_ASSIGN_ROMS )) {
203
201
/*
@@ -209,8 +207,7 @@ static int __init pcibios_assign_resources(void)
209
207
r = & dev -> resource [PCI_ROM_RESOURCE ];
210
208
if (!r -> flags || !r -> start )
211
209
continue ;
212
- pr = pci_find_parent_resource (dev , r );
213
- if (!pr || request_resource (pr , r ) < 0 ) {
210
+ if (pci_claim_resource (dev , PCI_ROM_RESOURCE ) < 0 ) {
214
211
r -> end -= r -> start ;
215
212
r -> start = 0 ;
216
213
}
0 commit comments