diff options
Diffstat (limited to 'drivers/net/stmmac/stmmac_main.c')
-rw-r--r-- | drivers/net/stmmac/stmmac_main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 29ba28660fa9..b806cd3515b4 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -1643,7 +1643,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1643 | struct resource *res; | 1643 | struct resource *res; |
1644 | void __iomem *addr = NULL; | 1644 | void __iomem *addr = NULL; |
1645 | struct net_device *ndev = NULL; | 1645 | struct net_device *ndev = NULL; |
1646 | struct stmmac_priv *priv; | 1646 | struct stmmac_priv *priv = NULL; |
1647 | struct plat_stmmacenet_data *plat_dat; | 1647 | struct plat_stmmacenet_data *plat_dat; |
1648 | 1648 | ||
1649 | pr_info("STMMAC driver:\n\tplatform registration... "); | 1649 | pr_info("STMMAC driver:\n\tplatform registration... "); |
@@ -1708,10 +1708,12 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1708 | /* Set the I/O base addr */ | 1708 | /* Set the I/O base addr */ |
1709 | ndev->base_addr = (unsigned long)addr; | 1709 | ndev->base_addr = (unsigned long)addr; |
1710 | 1710 | ||
1711 | /* Verify embedded resource for the platform */ | 1711 | /* Custom initialisation */ |
1712 | ret = stmmac_claim_resource(pdev); | 1712 | if (priv->plat->init) { |
1713 | if (ret < 0) | 1713 | ret = priv->plat->init(pdev); |
1714 | goto out; | 1714 | if (unlikely(ret)) |
1715 | goto out; | ||
1716 | } | ||
1715 | 1717 | ||
1716 | /* MAC HW revice detection */ | 1718 | /* MAC HW revice detection */ |
1717 | ret = stmmac_mac_device_setup(ndev); | 1719 | ret = stmmac_mac_device_setup(ndev); |
@@ -1745,6 +1747,9 @@ static int stmmac_dvr_probe(struct platform_device *pdev) | |||
1745 | 1747 | ||
1746 | out: | 1748 | out: |
1747 | if (ret < 0) { | 1749 | if (ret < 0) { |
1750 | if (priv->plat->exit) | ||
1751 | priv->plat->exit(pdev); | ||
1752 | |||
1748 | platform_set_drvdata(pdev, NULL); | 1753 | platform_set_drvdata(pdev, NULL); |
1749 | release_mem_region(res->start, resource_size(res)); | 1754 | release_mem_region(res->start, resource_size(res)); |
1750 | if (addr != NULL) | 1755 | if (addr != NULL) |
@@ -1778,6 +1783,9 @@ static int stmmac_dvr_remove(struct platform_device *pdev) | |||
1778 | 1783 | ||
1779 | stmmac_mdio_unregister(ndev); | 1784 | stmmac_mdio_unregister(ndev); |
1780 | 1785 | ||
1786 | if (priv->plat->exit) | ||
1787 | priv->plat->exit(pdev); | ||
1788 | |||
1781 | platform_set_drvdata(pdev, NULL); | 1789 | platform_set_drvdata(pdev, NULL); |
1782 | unregister_netdev(ndev); | 1790 | unregister_netdev(ndev); |
1783 | 1791 | ||