[OpenBIOS] [PATCH 09/10] pci: allow BARs with zero assigned address

Igor V. Kovalenko igor.v.kovalenko at gmail.com
Tue May 25 14:38:37 CEST 2010


From: Igor V. Kovalenko <igor.v.kovalenko at 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 at 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],




More information about the OpenBIOS mailing list