diff options
Diffstat (limited to 'drivers/pci/pci-layerscape.c')
-rw-r--r-- | drivers/pci/pci-layerscape.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/pci/pci-layerscape.c b/drivers/pci/pci-layerscape.c index d8f03fa599..12a0ec71a7 100644 --- a/drivers/pci/pci-layerscape.c +++ b/drivers/pci/pci-layerscape.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * PCIe host controller driver for Freescale Layerscape SoCs * @@ -21,7 +21,7 @@ #include <linux/kernel.h> #include <of_address.h> #include <of_pci.h> -#include <regmap.h> +#include <linux/regmap.h> #include <magicvar.h> #include <globalvar.h> #include <mfd/syscon.h> @@ -217,11 +217,11 @@ static int ls1021_pcie_host_init(struct pcie_port *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct ls_pcie *pcie = to_ls_pcie(pci); - struct device_d *dev = pci->dev; + struct device *dev = pci->dev; u32 index[2]; int ret; - pcie->scfg = syscon_regmap_lookup_by_phandle(dev->device_node, + pcie->scfg = syscon_regmap_lookup_by_phandle(dev->of_node, "fsl,pcie-scfg"); if (IS_ERR(pcie->scfg)) { ret = PTR_ERR(pcie->scfg); @@ -230,7 +230,7 @@ static int ls1021_pcie_host_init(struct pcie_port *pp) return ret; } - if (of_property_read_u32_array(dev->device_node, + if (of_property_read_u32_array(dev->of_node, "fsl,pcie-scfg", index, 2)) { pcie->scfg = NULL; return -EINVAL; @@ -312,12 +312,13 @@ static const struct of_device_id ls_pcie_of_match[] = { { .compatible = "fsl,ls1088a-pcie", .data = &ls2088_drvdata }, { }, }; +MODULE_DEVICE_TABLE(of, ls_pcie_of_match); static int __init ls_add_pcie_port(struct ls_pcie *pcie) { struct dw_pcie *pci = &pcie->pci; struct pcie_port *pp = &pci->pp; - struct device_d *dev = pci->dev; + struct device *dev = pci->dev; int ret; pp->ops = pcie->drvdata->ops; @@ -369,7 +370,7 @@ BAREBOX_MAGICVAR(global.layerscape_pcie.share_stream_ids, static int ls_pcie_of_fixup(struct device_node *root, void *ctx) { struct ls_pcie *pcie = ctx; - struct device_d *dev = pcie->pci.dev; + struct device *dev = pcie->pci.dev; struct device_node *np; phandle iommu_handle = 0; char *name; @@ -378,7 +379,7 @@ static int ls_pcie_of_fixup(struct device_node *root, void *ctx) int ret, i; u32 devid, stream_id; - name = of_get_reproducible_name(dev->device_node); + name = of_get_reproducible_name(dev->of_node); np = root; do { @@ -479,7 +480,7 @@ out: return ret; } -static int __init ls_pcie_probe(struct device_d *dev) +static int __init ls_pcie_probe(struct device *dev) { struct dw_pcie *pci; struct ls_pcie *pcie; @@ -532,7 +533,7 @@ static int __init ls_pcie_probe(struct device_d *dev) return 0; } -static struct driver_d ls_pcie_driver = { +static struct driver ls_pcie_driver = { .name = "layerscape-pcie", .of_compatible = DRV_OF_COMPAT(ls_pcie_of_match), .probe = ls_pcie_probe, @@ -550,6 +551,9 @@ static void ls_pcie_fixup(struct pci_dev *pcidev) uint32_t devid; int base_bus_num = 0; + if (!of_match_device(ls_pcie_of_match, host->parent)) + return; + stream_id = ls_pcie_next_streamid(lspcie); index = ls_pcie_next_lut_index(lspcie); |