aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/stmmac/stmmac_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/stmmac/stmmac_main.c')
-rw-r--r--drivers/net/stmmac/stmmac_main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index 79a938117878..d50fe6f171ef 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -45,7 +45,6 @@
45#include <linux/phy.h> 45#include <linux/phy.h>
46#include <linux/if_vlan.h> 46#include <linux/if_vlan.h>
47#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
48#include <linux/stm/soc.h>
49#include "stmmac.h" 48#include "stmmac.h"
50 49
51#define STMMAC_RESOURCE_NAME "stmmaceth" 50#define STMMAC_RESOURCE_NAME "stmmaceth"
@@ -1798,8 +1797,7 @@ static int stmmac_mac_device_setup(struct net_device *dev)
1798 1797
1799static int stmmacphy_dvr_probe(struct platform_device *pdev) 1798static int stmmacphy_dvr_probe(struct platform_device *pdev)
1800{ 1799{
1801 struct plat_stmmacphy_data *plat_dat; 1800 struct plat_stmmacphy_data *plat_dat = pdev->dev.platform_data;
1802 plat_dat = (struct plat_stmmacphy_data *)((pdev->dev).platform_data);
1803 1801
1804 pr_debug("stmmacphy_dvr_probe: added phy for bus %d\n", 1802 pr_debug("stmmacphy_dvr_probe: added phy for bus %d\n",
1805 plat_dat->bus_id); 1803 plat_dat->bus_id);
@@ -1831,9 +1829,7 @@ static struct platform_driver stmmacphy_driver = {
1831static int stmmac_associate_phy(struct device *dev, void *data) 1829static int stmmac_associate_phy(struct device *dev, void *data)
1832{ 1830{
1833 struct stmmac_priv *priv = (struct stmmac_priv *)data; 1831 struct stmmac_priv *priv = (struct stmmac_priv *)data;
1834 struct plat_stmmacphy_data *plat_dat; 1832 struct plat_stmmacphy_data *plat_dat = dev->platform_data;
1835
1836 plat_dat = (struct plat_stmmacphy_data *)(dev->platform_data);
1837 1833
1838 DBG(probe, DEBUG, "%s: checking phy for bus %d\n", __func__, 1834 DBG(probe, DEBUG, "%s: checking phy for bus %d\n", __func__,
1839 plat_dat->bus_id); 1835 plat_dat->bus_id);
@@ -1923,7 +1919,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
1923 priv = netdev_priv(ndev); 1919 priv = netdev_priv(ndev);
1924 priv->device = &(pdev->dev); 1920 priv->device = &(pdev->dev);
1925 priv->dev = ndev; 1921 priv->dev = ndev;
1926 plat_dat = (struct plat_stmmacenet_data *)((pdev->dev).platform_data); 1922 plat_dat = pdev->dev.platform_data;
1927 priv->bus_id = plat_dat->bus_id; 1923 priv->bus_id = plat_dat->bus_id;
1928 priv->pbl = plat_dat->pbl; /* TLI */ 1924 priv->pbl = plat_dat->pbl; /* TLI */
1929 priv->is_gmac = plat_dat->has_gmac; /* GMAC is on board */ 1925 priv->is_gmac = plat_dat->has_gmac; /* GMAC is on board */
@@ -1933,6 +1929,11 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
1933 /* Set the I/O base addr */ 1929 /* Set the I/O base addr */
1934 ndev->base_addr = (unsigned long)addr; 1930 ndev->base_addr = (unsigned long)addr;
1935 1931
1932 /* Verify embedded resource for the platform */
1933 ret = stmmac_claim_resource(pdev);
1934 if (ret < 0)
1935 goto out;
1936
1936 /* MAC HW revice detection */ 1937 /* MAC HW revice detection */
1937 ret = stmmac_mac_device_setup(ndev); 1938 ret = stmmac_mac_device_setup(ndev);
1938 if (ret < 0) 1939 if (ret < 0)
@@ -1953,6 +1954,7 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
1953 } 1954 }
1954 1955
1955 priv->fix_mac_speed = plat_dat->fix_mac_speed; 1956 priv->fix_mac_speed = plat_dat->fix_mac_speed;
1957 priv->bus_setup = plat_dat->bus_setup;
1956 priv->bsp_priv = plat_dat->bsp_priv; 1958 priv->bsp_priv = plat_dat->bsp_priv;
1957 1959
1958 pr_info("\t%s - (dev. name: %s - id: %d, IRQ #%d\n" 1960 pr_info("\t%s - (dev. name: %s - id: %d, IRQ #%d\n"