@@ -209,6 +209,24 @@ static int gen_pci_parse_map_cfg_windows(struct gen_pci *pci)
return 0;
}
+static int gen_pci_claim_resource_cb(struct pci_dev *dev, void *arg)
+{
+ int resno;
+
+ for (resno = 0; resno < PCI_BRIDGE_RESOURCES; resno++) {
+ struct resource *res = &dev->resource[resno];
+
+ /* If it already has a parent, don't claim it. */
+ if (res->parent)
+ continue;
+
+ if (resource_type(res) == IORESOURCE_MEM ||
+ resource_type(res) == IORESOURCE_IO)
+ pci_claim_resource(dev, resno);
+ }
+ return 0;
+}
+
static int gen_pci_probe(struct platform_device *pdev)
{
int err;
@@ -277,6 +295,9 @@ static int gen_pci_probe(struct platform_device *pdev)
}
pci_bus_add_devices(bus);
+
+ if (pci_has_flag(PCI_PROBE_ONLY))
+ pci_walk_bus(bus, gen_pci_claim_resource_cb, NULL);
return 0;
}