Commit 160b4e41 authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: mvebu: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent bdf53098
...@@ -1190,13 +1190,13 @@ static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port) ...@@ -1190,13 +1190,13 @@ static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port)
static int mvebu_pcie_probe(struct platform_device *pdev) static int mvebu_pcie_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct mvebu_pcie *pcie; struct mvebu_pcie *pcie;
struct device_node *np = pdev->dev.of_node; struct device_node *np = dev->of_node;
struct device_node *child; struct device_node *child;
int num, i, ret; int num, i, ret;
pcie = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pcie), pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
GFP_KERNEL);
if (!pcie) if (!pcie)
return -ENOMEM; return -ENOMEM;
...@@ -1206,7 +1206,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev) ...@@ -1206,7 +1206,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
/* Get the PCIe memory and I/O aperture */ /* Get the PCIe memory and I/O aperture */
mvebu_mbus_get_pcie_mem_aperture(&pcie->mem); mvebu_mbus_get_pcie_mem_aperture(&pcie->mem);
if (resource_size(&pcie->mem) == 0) { if (resource_size(&pcie->mem) == 0) {
dev_err(&pdev->dev, "invalid memory aperture size\n"); dev_err(dev, "invalid memory aperture size\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1224,20 +1224,18 @@ static int mvebu_pcie_probe(struct platform_device *pdev) ...@@ -1224,20 +1224,18 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
/* Get the bus range */ /* Get the bus range */
ret = of_pci_parse_bus_range(np, &pcie->busn); ret = of_pci_parse_bus_range(np, &pcie->busn);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to parse bus-range property: %d\n", dev_err(dev, "failed to parse bus-range property: %d\n", ret);
ret);
return ret; return ret;
} }
num = of_get_available_child_count(pdev->dev.of_node); num = of_get_available_child_count(dev->of_node);
pcie->ports = devm_kcalloc(&pdev->dev, num, sizeof(*pcie->ports), pcie->ports = devm_kcalloc(dev, num, sizeof(*pcie->ports), GFP_KERNEL);
GFP_KERNEL);
if (!pcie->ports) if (!pcie->ports)
return -ENOMEM; return -ENOMEM;
i = 0; i = 0;
for_each_available_child_of_node(pdev->dev.of_node, child) { for_each_available_child_of_node(dev->of_node, child) {
struct mvebu_pcie_port *port = &pcie->ports[i]; struct mvebu_pcie_port *port = &pcie->ports[i];
ret = mvebu_pcie_parse_port(pcie, port, child); ret = mvebu_pcie_parse_port(pcie, port, child);
...@@ -1266,8 +1264,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev) ...@@ -1266,8 +1264,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
port->base = mvebu_pcie_map_registers(pdev, child, port); port->base = mvebu_pcie_map_registers(pdev, child, port);
if (IS_ERR(port->base)) { if (IS_ERR(port->base)) {
dev_err(&pdev->dev, "%s: cannot map registers\n", dev_err(dev, "%s: cannot map registers\n", port->name);
port->name);
port->base = NULL; port->base = NULL;
mvebu_pcie_powerdown(port); mvebu_pcie_powerdown(port);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment