瀏覽代碼

PCI: iproc: Set drvdata at end of probe function

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>
Bjorn Helgaas 8 年之前
父節點
當前提交
556c7bb7df
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      drivers/pci/host/pcie-iproc-bcma.c
  2. 1 1
      drivers/pci/host/pcie-iproc-platform.c

+ 1 - 1
drivers/pci/host/pcie-iproc-bcma.c

@@ -53,7 +53,6 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	pcie->dev = dev;
 	pcie->dev = dev;
-	bcma_set_drvdata(bdev, pcie);
 
 
 	pcie->base = bdev->io_addr;
 	pcie->base = bdev->io_addr;
 	pcie->base_addr = bdev->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);
 	pci_free_resource_list(&res);
 
 
+	bcma_set_drvdata(bdev, pcie);
 	return ret;
 	return ret;
 }
 }
 
 

+ 1 - 1
drivers/pci/host/pcie-iproc-platform.c

@@ -59,7 +59,6 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 
 
 	pcie->dev = dev;
 	pcie->dev = dev;
 	pcie->type = (enum iproc_pcie_type)of_id->data;
 	pcie->type = (enum iproc_pcie_type)of_id->data;
-	platform_set_drvdata(pdev, pcie);
 
 
 	ret = of_address_to_resource(np, 0, &reg);
 	ret = of_address_to_resource(np, 0, &reg);
 	if (ret < 0) {
 	if (ret < 0) {
@@ -124,6 +123,7 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 
 
 	pci_free_resource_list(&res);
 	pci_free_resource_list(&res);
 
 
+	platform_set_drvdata(pdev, pcie);
 	return ret;
 	return ret;
 }
 }