Commit ed00f97d authored by Bjorn Helgaas's avatar Bjorn Helgaas

Merge branch 'pci/host-imx6' into next

* pci/host-imx6:
  PCI: imx6: Remove unneeded 'goto err'
  PCI: imx6: Remove unneeded check of platform_get_resource()
parents c354e811 b391bf31
...@@ -426,16 +426,9 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -426,16 +426,9 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
"imprecise external abort"); "imprecise external abort");
dbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0); dbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!dbi_base) {
dev_err(&pdev->dev, "dbi_base memory resource not found\n");
return -ENODEV;
}
pp->dbi_base = devm_ioremap_resource(&pdev->dev, dbi_base); pp->dbi_base = devm_ioremap_resource(&pdev->dev, dbi_base);
if (IS_ERR(pp->dbi_base)) { if (IS_ERR(pp->dbi_base))
ret = PTR_ERR(pp->dbi_base); return PTR_ERR(pp->dbi_base);
goto err;
}
/* Fetch GPIOs */ /* Fetch GPIOs */
imx6_pcie->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0); imx6_pcie->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0);
...@@ -449,7 +442,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -449,7 +442,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
"PCIe reset"); "PCIe reset");
if (ret) { if (ret) {
dev_err(&pdev->dev, "unable to get reset gpio\n"); dev_err(&pdev->dev, "unable to get reset gpio\n");
goto err; return ret;
} }
imx6_pcie->power_on_gpio = of_get_named_gpio(np, "power-on-gpio", 0); imx6_pcie->power_on_gpio = of_get_named_gpio(np, "power-on-gpio", 0);
...@@ -460,7 +453,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -460,7 +453,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
"PCIe power enable"); "PCIe power enable");
if (ret) { if (ret) {
dev_err(&pdev->dev, "unable to get power-on gpio\n"); dev_err(&pdev->dev, "unable to get power-on gpio\n");
goto err; return ret;
} }
} }
...@@ -472,7 +465,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -472,7 +465,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
"PCIe wake up"); "PCIe wake up");
if (ret) { if (ret) {
dev_err(&pdev->dev, "unable to get wake-up gpio\n"); dev_err(&pdev->dev, "unable to get wake-up gpio\n");
goto err; return ret;
} }
} }
...@@ -484,7 +477,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -484,7 +477,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
"PCIe disable endpoint"); "PCIe disable endpoint");
if (ret) { if (ret) {
dev_err(&pdev->dev, "unable to get disable-ep gpio\n"); dev_err(&pdev->dev, "unable to get disable-ep gpio\n");
goto err; return ret;
} }
} }
...@@ -493,32 +486,28 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -493,32 +486,28 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
if (IS_ERR(imx6_pcie->lvds_gate)) { if (IS_ERR(imx6_pcie->lvds_gate)) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"lvds_gate clock select missing or invalid\n"); "lvds_gate clock select missing or invalid\n");
ret = PTR_ERR(imx6_pcie->lvds_gate); return PTR_ERR(imx6_pcie->lvds_gate);
goto err;
} }
imx6_pcie->sata_ref_100m = devm_clk_get(&pdev->dev, "sata_ref_100m"); imx6_pcie->sata_ref_100m = devm_clk_get(&pdev->dev, "sata_ref_100m");
if (IS_ERR(imx6_pcie->sata_ref_100m)) { if (IS_ERR(imx6_pcie->sata_ref_100m)) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"sata_ref_100m clock source missing or invalid\n"); "sata_ref_100m clock source missing or invalid\n");
ret = PTR_ERR(imx6_pcie->sata_ref_100m); return PTR_ERR(imx6_pcie->sata_ref_100m);
goto err;
} }
imx6_pcie->pcie_ref_125m = devm_clk_get(&pdev->dev, "pcie_ref_125m"); imx6_pcie->pcie_ref_125m = devm_clk_get(&pdev->dev, "pcie_ref_125m");
if (IS_ERR(imx6_pcie->pcie_ref_125m)) { if (IS_ERR(imx6_pcie->pcie_ref_125m)) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"pcie_ref_125m clock source missing or invalid\n"); "pcie_ref_125m clock source missing or invalid\n");
ret = PTR_ERR(imx6_pcie->pcie_ref_125m); return PTR_ERR(imx6_pcie->pcie_ref_125m);
goto err;
} }
imx6_pcie->pcie_axi = devm_clk_get(&pdev->dev, "pcie_axi"); imx6_pcie->pcie_axi = devm_clk_get(&pdev->dev, "pcie_axi");
if (IS_ERR(imx6_pcie->pcie_axi)) { if (IS_ERR(imx6_pcie->pcie_axi)) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"pcie_axi clock source missing or invalid\n"); "pcie_axi clock source missing or invalid\n");
ret = PTR_ERR(imx6_pcie->pcie_axi); return PTR_ERR(imx6_pcie->pcie_axi);
goto err;
} }
/* Grab GPR config register range */ /* Grab GPR config register range */
...@@ -526,19 +515,15 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) ...@@ -526,19 +515,15 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
if (IS_ERR(imx6_pcie->iomuxc_gpr)) { if (IS_ERR(imx6_pcie->iomuxc_gpr)) {
dev_err(&pdev->dev, "unable to find iomuxc registers\n"); dev_err(&pdev->dev, "unable to find iomuxc registers\n");
ret = PTR_ERR(imx6_pcie->iomuxc_gpr); return PTR_ERR(imx6_pcie->iomuxc_gpr);
goto err;
} }
ret = imx6_add_pcie_port(pp, pdev); ret = imx6_add_pcie_port(pp, pdev);
if (ret < 0) if (ret < 0)
goto err; return ret;
platform_set_drvdata(pdev, imx6_pcie); platform_set_drvdata(pdev, imx6_pcie);
return 0; return 0;
err:
return ret;
} }
static const struct of_device_id imx6_pcie_of_match[] = { static const struct of_device_id imx6_pcie_of_match[] = {
......
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