Message ID | e1bcfc3078c82b53aa9b78077a89955abe4ea009.1678380991.git.hns@goldelico.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] PCI: imx6: install the fault handler only if we are really running on a compatible device | expand |
On Thu, 09 Mar 2023 17:56:31 +0100, H. Nikolaus Schaller wrote: > commit bb38919ec56e ("PCI: imx6: Add support for i.MX6 PCIe controller") > added a fault hook to this driver in the probe function. So it was only > installed if needed. > > commit bde4a5a00e76 ("PCI: imx6: Allow probe deferral by reset GPIO") > moved it from probe to driver init which installs the hook unconditionally > as soon as the driver is compiled into a kernel. > > [...] Applied to controller/dwc, thanks! [1/1] PCI: imx6: install the fault handler only if we are really running on a compatible device https://git.kernel.org/pci/pci/c/5f5ac460dfe7 Thanks, Lorenzo
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 55a0405b921d6..52906f999f2bb 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1566,6 +1566,13 @@ DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_SYNOPSYS, 0xabcd, static int __init imx6_pcie_init(void) { #ifdef CONFIG_ARM + struct device_node *np; + + np = of_find_matching_node(NULL, imx6_pcie_of_match); + if (!np) + return -ENODEV; + of_node_put(np); + /* * Since probe() can be deferred we need to make sure that * hook_fault_code is not called after __init memory is freed