]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: dra7xx: Set drvdata at end of probe function
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 6 Oct 2016 18:33:07 +0000 (13:33 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 12 Oct 2016 02:02:00 +0000 (21:02 -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/pci-dra7xx.c

index 1c24f341177660d4e0887430af7f9e5c3b04cbe9..3d184f64910573d81b28c7e1d58515f46f622f08 100644 (file)
@@ -418,12 +418,11 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
        reg &= ~LTSSM_EN;
        dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD, reg);
 
-       platform_set_drvdata(pdev, dra7xx);
-
        ret = dra7xx_add_pcie_port(dra7xx, pdev);
        if (ret < 0)
                goto err_gpio;
 
+       platform_set_drvdata(pdev, dra7xx);
        return 0;
 
 err_gpio: