if (err < 0)
return err;
- pci_ioremap_io(pcie->pio.start, pcie->io.start);
- err = devm_request_resource(pcie->dev, &pcie->all, &pcie->mem);
- if (err < 0)
- return err;
-
- err = devm_request_resource(pcie->dev, &pcie->all, &pcie->prefetch);
- if (err)
- return err;
--
pci_add_resource_offset(&sys->resources, &pcie->pio, sys->io_offset);
pci_add_resource_offset(&sys->resources, &pcie->mem, sys->mem_offset);
pci_add_resource_offset(&sys->resources, &pcie->prefetch,
sys->mem_offset);
pci_add_resource(&sys->resources, &pcie->busn);
- pci_remap_iospace(&pcie->pio, pcie->io.start);
+ err = devm_request_pci_bus_resources(pcie->dev, &sys->resources);
+ if (err < 0)
+ return err;
++ pci_remap_iospace(&pcie->pio, pcie->io.start);
return 1;
}