hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/pci/controller/pcie-iproc-bcma.c
....@@ -35,7 +35,6 @@
3535 {
3636 struct device *dev = &bdev->dev;
3737 struct iproc_pcie *pcie;
38
- LIST_HEAD(resources);
3938 struct pci_host_bridge *bridge;
4039 int ret;
4140
....@@ -60,19 +59,16 @@
6059 pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1;
6160 pcie->mem.name = "PCIe MEM space";
6261 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;
6466
6567 pcie->map_irq = iproc_pcie_bcma_map_irq;
6668
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
-
7469 bcma_set_drvdata(bdev, pcie);
75
- return 0;
70
+
71
+ return iproc_pcie_setup(pcie, &bridge->windows);
7672 }
7773
7874 static void iproc_pcie_bcma_remove(struct bcma_device *bdev)
....@@ -94,18 +90,7 @@
9490 .probe = iproc_pcie_bcma_probe,
9591 .remove = iproc_pcie_bcma_remove,
9692 };
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);
10994
11095 MODULE_AUTHOR("Hauke Mehrtens");
11196 MODULE_DESCRIPTION("Broadcom iProc PCIe BCMA driver");