stmmac: move driver data setting into stmmac_dvr_probe
authorJoachim Eastwood <manabian@gmail.com>
Wed, 20 May 2015 18:03:06 +0000 (20:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 May 2015 22:57:26 +0000 (18:57 -0400)
Move setting of driver data into stmmac_dvr_probe so the
other probe functions don't have to. This will help to
simplify the other probe functions later.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index 42e1492ea845fd4f6c50c05ee43337756f44a116..396eb59768be5a7b7ccfc02622b08d1b060e96ed 100644 (file)
@@ -2828,6 +2828,8 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
        priv->ioaddr = addr;
        priv->dev->base_addr = (unsigned long)addr;
 
+       dev_set_drvdata(device, priv);
+
        /* Verify driver arguments */
        stmmac_verify_args();
 
index 3bca908716e2a5c52a82ee6e6d8e67b9b10d23c6..4743d0017d7996580c4ce2accb78b1ee0d099cd1 100644 (file)
@@ -222,8 +222,6 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
        priv->dev->irq = pdev->irq;
        priv->wol_irq = pdev->irq;
 
-       pci_set_drvdata(pdev, priv->dev);
-
        dev_dbg(&pdev->dev, "STMMAC PCI driver registration completed\n");
 
        return 0;
index 3e194c3ca2977b257458fecde72eba4ac83cd3a3..8d7e160c2c5b4db4a0a0edba353fb813dd7a4a8a 100644 (file)
@@ -350,8 +350,6 @@ int stmmac_pltfr_probe(struct platform_device *pdev)
        if (mac)
                memcpy(priv->dev->dev_addr, mac, ETH_ALEN);
 
-       platform_set_drvdata(pdev, priv->dev);
-
        pr_debug("STMMAC platform driver registration completed");
 
        return 0;