]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
PCI: iproc: Set drvdata at end of probe function
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 6 Oct 2016 18:36:08 +0000 (13:36 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 12 Oct 2016 03:36:38 +0000 (22:36 -0500)
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
drivers/pci/host/pcie-iproc-platform.c

index 94d1101fbf8d28ec6ace6465983369e9dd87cb4b..ec6edafdaabfc7ebead38a7fd7da272df96bf9c9 100644 (file)
@@ -53,7 +53,6 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
                return -ENOMEM;
 
        pcie->dev = dev;
-       bcma_set_drvdata(bdev, pcie);
 
        pcie->base = bdev->io_addr;
        pcie->base_addr = bdev->addr;
@@ -72,6 +71,7 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
 
        pci_free_resource_list(&res);
 
+       bcma_set_drvdata(bdev, pcie);
        return ret;
 }
 
index 6030dc1644d27f7da101b084d79eee6bf627200f..a3de087976b31b2586d0f1f064ee892805cac4b9 100644 (file)
@@ -59,7 +59,6 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 
        pcie->dev = dev;
        pcie->type = (enum iproc_pcie_type)of_id->data;
-       platform_set_drvdata(pdev, pcie);
 
        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, pcie);
        return ret;
 }