From: Igor V. Kovalenko igor.v.kovalenko@gmail.com
- consider only PCI BARs with non-zero region size when pupulating "reg" and "assigned-addresses" properties
Signed-off-by: Igor V. Kovalenko igor.v.kovalenko@gmail.com --- drivers/pci.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c index 5a2be02..d22ac58 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -603,7 +603,8 @@ static void pci_set_assigned_addresses(phandle_t phandle,
ncells = 0; for (i = 0; i < num_bars; i++) { - if (!config->assigned[i] || !config->sizes[i]) + /* consider only bars with non-zero region size */ + if (!config->sizes[i]) continue; pci_decode_pci_addr(config->assigned[i], &flags, &space_code, &mask); @@ -662,7 +663,8 @@ static void pci_set_reg(phandle_t phandle, ncells += pci_encode_size(props + ncells, 0);
for (i = 0; i < num_bars; i++) { - if (!config->assigned[i] || !config->sizes[i]) + /* consider only bars with non-zero region size */ + if (!config->sizes[i]) continue;
pci_decode_pci_addr(config->regions[i],