diff options
Diffstat (limited to 'drivers/pci/pci-mvebu.c')
-rw-r--r-- | drivers/pci/pci-mvebu.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/pci/pci-mvebu.c b/drivers/pci/pci-mvebu.c index ae2e83dacd..988465a344 100644 --- a/drivers/pci/pci-mvebu.c +++ b/drivers/pci/pci-mvebu.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * PCIe driver for Marvell MVEBU SoCs * @@ -262,7 +262,7 @@ static int mvebu_get_target_attr(struct device_node *np, int devfn, return -ENOENT; } -static struct mvebu_pcie *mvebu_pcie_port_probe(struct device_d *dev, +static struct mvebu_pcie *mvebu_pcie_port_probe(struct device *dev, struct device_node *np) { struct mvebu_pcie *pcie; @@ -270,8 +270,8 @@ static struct mvebu_pcie *mvebu_pcie_port_probe(struct device_d *dev, enum of_gpio_flags flags; struct property *prop; const __be32 *p; - int reset_gpio; - u32 u, port, lane, lane_mask, devfn; + int reset_gpio, devfn; + u32 u, port, lane, lane_mask; int mem_target, mem_attr; int io_target, io_attr; int ret; @@ -292,14 +292,14 @@ static struct mvebu_pcie *mvebu_pcie_port_probe(struct device_d *dev, return ERR_PTR(-EINVAL); } - if (mvebu_get_target_attr(dev->device_node, devfn, IORESOURCE_MEM, + if (mvebu_get_target_attr(dev->of_node, devfn, IORESOURCE_MEM, &mem_target, &mem_attr)) { dev_err(dev, "unable to get target/attr for mem window\n"); return ERR_PTR(-EINVAL); } /* I/O windows are optional */ - mvebu_get_target_attr(dev->device_node, devfn, IORESOURCE_IO, + mvebu_get_target_attr(dev->of_node, devfn, IORESOURCE_IO, &io_target, &io_attr); reset_gpio = of_get_named_gpio_flags(np, "reset-gpios", 0, &flags); @@ -322,6 +322,9 @@ static struct mvebu_pcie *mvebu_pcie_port_probe(struct device_d *dev, } pcie = xzalloc(sizeof(*pcie)); + + pci_controller_init(&pcie->pci); + pcie->port = port; pcie->lane = lane; pcie->lane_mask = lane_mask; @@ -395,10 +398,11 @@ static struct of_device_id mvebu_pcie_dt_ids[] = { #endif { }, }; +MODULE_DEVICE_TABLE(of, mvebu_pcie_dt_ids); -static int mvebu_pcie_probe(struct device_d *dev) +static int mvebu_pcie_probe(struct device *dev) { - struct device_node *np = dev->device_node; + struct device_node *np = dev->of_node; const struct of_device_id *match = of_match_node(mvebu_pcie_dt_ids, np); struct mvebu_pcie_ops *ops = (struct mvebu_pcie_ops *)match->data; struct device_node *pnp; @@ -437,7 +441,7 @@ static int mvebu_pcie_probe(struct device_d *dev) return 0; } -static struct driver_d mvebu_pcie_driver = { +static struct driver mvebu_pcie_driver = { .name = "mvebu-pcie", .probe = mvebu_pcie_probe, .of_compatible = mvebu_pcie_dt_ids, |