Skip to content

Commit

Permalink
PCI: iproc: Set drvdata at end of probe function
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bjorn-helgaas committed Oct 12, 2016
1 parent 786aecc commit 556c7bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/pci/host/pcie-iproc-bcma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/host/pcie-iproc-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 556c7bb

Please sign in to comment.