From 2f4d1c8c5a44847058f84f557201a53b2ca9b2f9 Mon Sep 17 00:00:00 2001 From: Richard Zhu Date: Thu, 15 Jun 2017 11:41:34 +0800 Subject: [PATCH] MLK-15080 PCI: imx: pcie ep can't be probed properly iMX7D Sabre SD board implement the GPIO expander connected to a peripheral bus. Probe deferral would be triggered when try to request the expanded GPIO at the first time. pcie ep can't be probed properly at the second probe, because of the duplicated registration of the sysfs. Change the registeration point of the sysfs to fix this issue. Signed-off-by: Richard Zhu --- drivers/pci/host/pci-imx6.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index 250952e7691e..a9e0a32054b5 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -1201,14 +1201,6 @@ static int imx6_pcie_probe(struct platform_device *pdev) imx6_pcie->variant = (enum imx6_pcie_variants)of_device_get_match_data(dev); - if (IS_ENABLED(CONFIG_EP_MODE_IN_EP_RC_SYS)) { - /* add attributes for device */ - ret = sysfs_create_group(&pdev->dev.kobj, &imx_pcie_attrgroup); - if (ret) - return -EINVAL; - } - - np = of_find_compatible_node(NULL, NULL, "fsl,imx-pcie-phy"); if (np != NULL) { imx6_pcie->phy_base = of_iomap(np, 0); @@ -1391,6 +1383,11 @@ static int imx6_pcie_probe(struct platform_device *pdev) LIST_HEAD(res); struct resource_entry *win, *tmp; + /* add attributes for device */ + ret = sysfs_create_group(&pdev->dev.kobj, &imx_pcie_attrgroup); + if (ret) + return -EINVAL; + ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &res, &pp->io_base); if (ret) -- 2.17.1