Skip to content

Commit

Permalink
PCI: layerscape: Simplify platform_get_resource_byname() failure chec…
Browse files Browse the repository at this point in the history
…king

devm_ioremap_resource() validates the resource it receives, so if we check
for devm_ioremap_resource() failure, we need not check for failure of the
preceding platform_get_resource().

Signed-off-by: Bjorn Helgaas <[email protected]>
  • Loading branch information
bjorn-helgaas committed Apr 9, 2015
1 parent c517d83 commit e3dc17a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/pci/host/pci-layerscape.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,11 @@ static int __init ls_pcie_probe(struct platform_device *pdev)
pcie->dev = &pdev->dev;

dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
if (!dbi_base) {
dev_err(&pdev->dev, "missing *regs* space\n");
return -ENODEV;
}

pcie->dbi = devm_ioremap_resource(&pdev->dev, dbi_base);
if (IS_ERR(pcie->dbi))
if (IS_ERR(pcie->dbi)) {
dev_err(&pdev->dev, "missing *regs* space\n");
return PTR_ERR(pcie->dbi);
}

pcie->scfg = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
"fsl,pcie-scfg");
Expand Down

0 comments on commit e3dc17a

Please sign in to comment.