Skip to content

Commit

Permalink
PCI: tegra: Request host bridge window resources with core function
Browse files Browse the repository at this point in the history
Use devm_request_pci_bus_resources() to request host bridge window
resources instead of doing it by hand in the driver.

No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Bjorn Helgaas committed Jun 25, 2016
1 parent c4102c9 commit 45c64b6
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions drivers/pci/host/pci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,25 +626,17 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
if (err < 0)
return err;

err = devm_request_resource(pcie->dev, &ioport_resource, &pcie->pio);
if (err < 0)
return err;

err = devm_request_resource(pcie->dev, &iomem_resource, &pcie->mem);
if (err < 0)
return err;

err = devm_request_resource(pcie->dev, &iomem_resource, &pcie->prefetch);
if (err)
return err;
pci_ioremap_io(pcie->pio.start, pcie->io.start);

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_ioremap_io(pcie->pio.start, pcie->io.start);
err = devm_request_pci_bus_resources(pcie->dev, &sys->resources);
if (err < 0)
return err;

return 1;
}
Expand Down

0 comments on commit 45c64b6

Please sign in to comment.