diff mbox

[7/8] PCI: armada: Reorder local declaration

Message ID 20161007163209.24582.85495.stgit@bhelgaas-glaptop2.roam.corp.google.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Bjorn Helgaas Oct. 7, 2016, 4:32 p.m. UTC
Move initialized local variable declaration to top and set drvdata pointer
only when the probe function succeeds.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/host/pcie-armada8k.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/host/pcie-armada8k.c b/drivers/pci/host/pcie-armada8k.c
index 19086a4..36002e4 100644
--- a/drivers/pci/host/pcie-armada8k.c
+++ b/drivers/pci/host/pcie-armada8k.c
@@ -197,9 +197,9 @@  static int armada8k_add_pcie_port(struct armada8k_pcie *armada8k,
 
 static int armada8k_pcie_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	struct armada8k_pcie *armada8k;
 	struct pcie_port *pp;
-	struct device *dev = &pdev->dev;
 	struct resource *base;
 	int ret;
 
@@ -215,7 +215,6 @@  static int armada8k_pcie_probe(struct platform_device *pdev)
 
 	pp = &armada8k->pp;
 	pp->dev = dev;
-	platform_set_drvdata(pdev, armada8k);
 
 	/* Get the dw-pcie unit configuration/control registers base. */
 	base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
@@ -230,6 +229,7 @@  static int armada8k_pcie_probe(struct platform_device *pdev)
 	if (ret)
 		goto fail;
 
+	platform_set_drvdata(pdev, armada8k);
 	return 0;
 
 fail: