diff options
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 1ac83243649a..3aad9810237c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -59,16 +59,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
59 | goto out_release_region; | 59 | goto out_release_region; |
60 | } | 60 | } |
61 | plat_dat = pdev->dev.platform_data; | 61 | plat_dat = pdev->dev.platform_data; |
62 | priv = stmmac_dvr_probe(&(pdev->dev), plat_dat); | 62 | |
63 | /* Custom initialisation (if needed)*/ | ||
64 | if (plat_dat->init) { | ||
65 | ret = plat_dat->init(pdev); | ||
66 | if (unlikely(ret)) | ||
67 | goto out_unmap; | ||
68 | } | ||
69 | |||
70 | priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr); | ||
63 | if (!priv) { | 71 | if (!priv) { |
64 | pr_err("%s: main drivr probe failed", __func__); | 72 | pr_err("%s: main driver probe failed", __func__); |
65 | goto out_unmap; | 73 | goto out_unmap; |
66 | } | 74 | } |
67 | 75 | ||
68 | priv->ioaddr = addr; | ||
69 | /* Set the I/O base addr */ | ||
70 | priv->dev->base_addr = (unsigned long)addr; | ||
71 | |||
72 | /* Get the MAC information */ | 76 | /* Get the MAC information */ |
73 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); | 77 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); |
74 | if (priv->dev->irq == -ENXIO) { | 78 | if (priv->dev->irq == -ENXIO) { |
@@ -92,13 +96,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
92 | 96 | ||
93 | platform_set_drvdata(pdev, priv->dev); | 97 | platform_set_drvdata(pdev, priv->dev); |
94 | 98 | ||
95 | /* Custom initialisation */ | ||
96 | if (priv->plat->init) { | ||
97 | ret = priv->plat->init(pdev); | ||
98 | if (unlikely(ret)) | ||
99 | goto out_unmap; | ||
100 | } | ||
101 | |||
102 | pr_debug("STMMAC platform driver registration completed"); | 99 | pr_debug("STMMAC platform driver registration completed"); |
103 | 100 | ||
104 | return 0; | 101 | return 0; |