| .. | .. |
|---|
| 35 | 35 | { |
|---|
| 36 | 36 | struct device *dev = &bdev->dev; |
|---|
| 37 | 37 | struct iproc_pcie *pcie; |
|---|
| 38 | | - LIST_HEAD(resources); |
|---|
| 39 | 38 | struct pci_host_bridge *bridge; |
|---|
| 40 | 39 | int ret; |
|---|
| 41 | 40 | |
|---|
| .. | .. |
|---|
| 60 | 59 | pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1; |
|---|
| 61 | 60 | pcie->mem.name = "PCIe MEM space"; |
|---|
| 62 | 61 | pcie->mem.flags = IORESOURCE_MEM; |
|---|
| 63 | | - pci_add_resource(&resources, &pcie->mem); |
|---|
| 62 | + pci_add_resource(&bridge->windows, &pcie->mem); |
|---|
| 63 | + ret = devm_request_pci_bus_resources(dev, &bridge->windows); |
|---|
| 64 | + if (ret) |
|---|
| 65 | + return ret; |
|---|
| 64 | 66 | |
|---|
| 65 | 67 | pcie->map_irq = iproc_pcie_bcma_map_irq; |
|---|
| 66 | 68 | |
|---|
| 67 | | - ret = iproc_pcie_setup(pcie, &resources); |
|---|
| 68 | | - if (ret) { |
|---|
| 69 | | - dev_err(dev, "PCIe controller setup failed\n"); |
|---|
| 70 | | - pci_free_resource_list(&resources); |
|---|
| 71 | | - return ret; |
|---|
| 72 | | - } |
|---|
| 73 | | - |
|---|
| 74 | 69 | bcma_set_drvdata(bdev, pcie); |
|---|
| 75 | | - return 0; |
|---|
| 70 | + |
|---|
| 71 | + return iproc_pcie_setup(pcie, &bridge->windows); |
|---|
| 76 | 72 | } |
|---|
| 77 | 73 | |
|---|
| 78 | 74 | static void iproc_pcie_bcma_remove(struct bcma_device *bdev) |
|---|
| .. | .. |
|---|
| 94 | 90 | .probe = iproc_pcie_bcma_probe, |
|---|
| 95 | 91 | .remove = iproc_pcie_bcma_remove, |
|---|
| 96 | 92 | }; |
|---|
| 97 | | - |
|---|
| 98 | | -static int __init iproc_pcie_bcma_init(void) |
|---|
| 99 | | -{ |
|---|
| 100 | | - return bcma_driver_register(&iproc_pcie_bcma_driver); |
|---|
| 101 | | -} |
|---|
| 102 | | -module_init(iproc_pcie_bcma_init); |
|---|
| 103 | | - |
|---|
| 104 | | -static void __exit iproc_pcie_bcma_exit(void) |
|---|
| 105 | | -{ |
|---|
| 106 | | - bcma_driver_unregister(&iproc_pcie_bcma_driver); |
|---|
| 107 | | -} |
|---|
| 108 | | -module_exit(iproc_pcie_bcma_exit); |
|---|
| 93 | +module_bcma_driver(iproc_pcie_bcma_driver); |
|---|
| 109 | 94 | |
|---|
| 110 | 95 | MODULE_AUTHOR("Hauke Mehrtens"); |
|---|
| 111 | 96 | MODULE_DESCRIPTION("Broadcom iProc PCIe BCMA driver"); |
|---|