File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
drivers/pci/controller/dwc Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -242,18 +242,24 @@ static struct pci_ops al_child_pci_ops = {
242
242
.write = pci_generic_config_write ,
243
243
};
244
244
245
- static void al_pcie_config_prepare (struct al_pcie * pcie )
245
+ static int al_pcie_config_prepare (struct al_pcie * pcie )
246
246
{
247
247
struct al_pcie_target_bus_cfg * target_bus_cfg ;
248
248
struct dw_pcie_rp * pp = & pcie -> pci -> pp ;
249
249
unsigned int ecam_bus_mask ;
250
+ struct resource_entry * ft ;
250
251
u32 cfg_control_offset ;
252
+ struct resource * bus ;
251
253
u8 subordinate_bus ;
252
254
u8 secondary_bus ;
253
255
u32 cfg_control ;
254
256
u32 reg ;
255
- struct resource * bus = resource_list_first_type (& pp -> bridge -> windows , IORESOURCE_BUS )-> res ;
256
257
258
+ ft = resource_list_first_type (& pp -> bridge -> windows , IORESOURCE_BUS );
259
+ if (!ft )
260
+ return - ENODEV ;
261
+
262
+ bus = ft -> res ;
257
263
target_bus_cfg = & pcie -> target_bus_cfg ;
258
264
259
265
ecam_bus_mask = (pcie -> ecam_size >> PCIE_ECAM_BUS_SHIFT ) - 1 ;
@@ -287,6 +293,8 @@ static void al_pcie_config_prepare(struct al_pcie *pcie)
287
293
FIELD_PREP (CFG_CONTROL_SEC_BUS_MASK , secondary_bus );
288
294
289
295
al_pcie_controller_writel (pcie , cfg_control_offset , reg );
296
+
297
+ return 0 ;
290
298
}
291
299
292
300
static int al_pcie_host_init (struct dw_pcie_rp * pp )
@@ -305,7 +313,9 @@ static int al_pcie_host_init(struct dw_pcie_rp *pp)
305
313
if (rc )
306
314
return rc ;
307
315
308
- al_pcie_config_prepare (pcie );
316
+ rc = al_pcie_config_prepare (pcie );
317
+ if (rc )
318
+ return rc ;
309
319
310
320
return 0 ;
311
321
}
You can’t perform that action at this time.
0 commit comments