Skip to content

Commit a43f32d

Browse files
matweybjorn-helgaas
authored andcommitted
PCI: spear: Drop __initdata from spear13xx_pcie_driver
Struct spear13xx_pcie_driver was in initdata, but we passed a pointer to it to platform_driver_register(), which can use the pointer at arbitrary times in the future, even after the initdata is freed. That leads to crashes. Move spear13xx_pcie_driver and things referenced by it (spear13xx_pcie_probe() and dw_pcie_host_init()) out of initdata. [bhelgaas: changelog] Fixes: 6675ef2 ("PCI: spear: Fix Section mismatch compilation warning for probe()") Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> CC: stable@vger.kernel.org # v3.17+
1 parent 085a68d commit a43f32d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/pci/host/pcie-designware.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static const struct irq_domain_ops msi_domain_ops = {
342342
.map = dw_pcie_msi_map,
343343
};
344344

345-
int __init dw_pcie_host_init(struct pcie_port *pp)
345+
int dw_pcie_host_init(struct pcie_port *pp)
346346
{
347347
struct device_node *np = pp->dev->of_node;
348348
struct platform_device *pdev = to_platform_device(pp->dev);

‎drivers/pci/host/pcie-spear13xx.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static struct pcie_host_ops spear13xx_pcie_host_ops = {
269269
.host_init = spear13xx_pcie_host_init,
270270
};
271271

272-
static int __init spear13xx_add_pcie_port(struct pcie_port *pp,
272+
static int spear13xx_add_pcie_port(struct pcie_port *pp,
273273
struct platform_device *pdev)
274274
{
275275
struct device *dev = &pdev->dev;
@@ -299,7 +299,7 @@ static int __init spear13xx_add_pcie_port(struct pcie_port *pp,
299299
return 0;
300300
}
301301

302-
static int __init spear13xx_pcie_probe(struct platform_device *pdev)
302+
static int spear13xx_pcie_probe(struct platform_device *pdev)
303303
{
304304
struct spear13xx_pcie *spear13xx_pcie;
305305
struct pcie_port *pp;
@@ -370,7 +370,7 @@ static const struct of_device_id spear13xx_pcie_of_match[] = {
370370
};
371371
MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match);
372372

373-
static struct platform_driver spear13xx_pcie_driver __initdata = {
373+
static struct platform_driver spear13xx_pcie_driver = {
374374
.probe = spear13xx_pcie_probe,
375375
.driver = {
376376
.name = "spear-pcie",

0 commit comments

Comments
 (0)