aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-04-02 09:35:10 +0000
committerDavid S. Miller <davem@davemloft.net>2013-04-02 16:43:56 -0400
commit6c5f7808efd7efc27be0f3c102f2a631ad6f038c (patch)
tree5173fe9abb2e1685f1c3a85a3c4796f62a03c3ee /drivers/net/ethernet/freescale
parentnet/cadence/macb: Simplify OF dependencies (diff)
downloadlinux-dev-6c5f7808efd7efc27be0f3c102f2a631ad6f038c.tar.xz
linux-dev-6c5f7808efd7efc27be0f3c102f2a631ad6f038c.zip
net/freescale/fec: Simplify OF dependencies
Since of_get_mac_address() is now defined even if CONFIG_OF_NET is not configured, the ifdef around the code calling it is no longer necessary and can be removed. Similar, since of_get_phy_mode() is now defined as dummy function if OF_NET is not configured, it is no longer necessary to provide an OF dependent function as front-end. Also, the function depends on OF_NET, not on OF, so the conditional code was not correct anyway. Drop the front-end function and call of_get_phy_mode() directly. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index a82a70345bbf..621d07565dce 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -913,7 +913,6 @@ static void fec_get_mac(struct net_device *ndev)
*/
iap = macaddr;
-#ifdef CONFIG_OF
/*
* 2) from device tree data
*/
@@ -925,7 +924,6 @@ static void fec_get_mac(struct net_device *ndev)
iap = (unsigned char *) mac;
}
}
-#endif
/*
* 3) from flash or fuse (via platform data)
@@ -1679,16 +1677,6 @@ static int fec_enet_init(struct net_device *ndev)
}
#ifdef CONFIG_OF
-static int fec_get_phy_mode_dt(struct platform_device *pdev)
-{
- struct device_node *np = pdev->dev.of_node;
-
- if (np)
- return of_get_phy_mode(np);
-
- return -ENODEV;
-}
-
static void fec_reset_phy(struct platform_device *pdev)
{
int err, phy_reset;
@@ -1717,11 +1705,6 @@ static void fec_reset_phy(struct platform_device *pdev)
gpio_set_value(phy_reset, 1);
}
#else /* CONFIG_OF */
-static int fec_get_phy_mode_dt(struct platform_device *pdev)
-{
- return -ENODEV;
-}
-
static void fec_reset_phy(struct platform_device *pdev)
{
/*
@@ -1780,7 +1763,7 @@ fec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev);
- ret = fec_get_phy_mode_dt(pdev);
+ ret = of_get_phy_mode(pdev->dev.of_node);
if (ret < 0) {
pdata = pdev->dev.platform_data;
if (pdata)