Skip to content

Commit 7994db9

Browse files
Uwe Kleine-Königbjorn-helgaas
authored andcommitted
PCI: keystone: Don't discard .probe() callback
The __init annotation makes the ks_pcie_probe() function disappear after booting completes. However a device can also be bound later. In that case, we try to call ks_pcie_probe(), but the backing memory is likely already overwritten. The right thing to do is do always have the probe callback available. Note that the (wrong) __refdata annotation prevented this issue to be noticed by modpost. Fixes: 0c4ffcf ("PCI: keystone: Add TI Keystone PCIe driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: [email protected]
1 parent 200bddb commit 7994db9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ static const struct of_device_id ks_pcie_of_match[] = {
11001100
{ },
11011101
};
11021102

1103-
static int __init ks_pcie_probe(struct platform_device *pdev)
1103+
static int ks_pcie_probe(struct platform_device *pdev)
11041104
{
11051105
const struct dw_pcie_host_ops *host_ops;
11061106
const struct dw_pcie_ep_ops *ep_ops;
@@ -1318,7 +1318,7 @@ static int ks_pcie_remove(struct platform_device *pdev)
13181318
return 0;
13191319
}
13201320

1321-
static struct platform_driver ks_pcie_driver __refdata = {
1321+
static struct platform_driver ks_pcie_driver = {
13221322
.probe = ks_pcie_probe,
13231323
.remove = ks_pcie_remove,
13241324
.driver = {

0 commit comments

Comments
 (0)