diff mbox

[7/7] PCI: iproc: Set drvdata at end of probe function

Message ID 20161007162400.23015.76859.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:24 p.m. UTC
Set the drvdata pointer at the end of probe function for consistency with
other drivers.  We don't need the drvdata until after the probe completes,
and we don't need it at all if the probe fails.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/host/pcie-iproc-bcma.c     |    2 +-
 drivers/pci/host/pcie-iproc-platform.c |    2 +-
 2 files 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-iproc-bcma.c b/drivers/pci/host/pcie-iproc-bcma.c
index bc364a7..800bc84 100644
--- a/drivers/pci/host/pcie-iproc-bcma.c
+++ b/drivers/pci/host/pcie-iproc-bcma.c
@@ -53,7 +53,6 @@  static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
 		return -ENOMEM;
 
 	iproc->dev = dev;
-	bcma_set_drvdata(bdev, iproc);
 
 	iproc->base = bdev->io_addr;
 	if (!iproc->base) {
@@ -77,6 +76,7 @@  static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
 
 	pci_free_resource_list(&res);
 
+	bcma_set_drvdata(bdev, iproc);
 	return ret;
 }
 
diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c
index 6baaae1..31c0fb9 100644
--- a/drivers/pci/host/pcie-iproc-platform.c
+++ b/drivers/pci/host/pcie-iproc-platform.c
@@ -59,7 +59,6 @@  static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 
 	iproc->dev = dev;
 	iproc->type = (enum iproc_pcie_type)of_id->data;
-	platform_set_drvdata(pdev, iproc);
 
 	ret = of_address_to_resource(np, 0, &reg);
 	if (ret < 0) {
@@ -124,6 +123,7 @@  static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 
 	pci_free_resource_list(&res);
 
+	platform_set_drvdata(pdev, iproc);
 	return ret;
 }