aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale/fec_main.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-04-02 05:35:10 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-02 16:43:56 -0400
commit6c5f7808efd7efc27be0f3c102f2a631ad6f038c (patch)
tree5173fe9abb2e1685f1c3a85a3c4796f62a03c3ee /drivers/net/ethernet/freescale/fec_main.c
parent509070437d15ed06c3b0aa674661adc2906b83f2 (diff)
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/fec_main.c')
-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)
913 */ 913 */
914 iap = macaddr; 914 iap = macaddr;
915 915
916#ifdef CONFIG_OF
917 /* 916 /*
918 * 2) from device tree data 917 * 2) from device tree data
919 */ 918 */
@@ -925,7 +924,6 @@ static void fec_get_mac(struct net_device *ndev)
925 iap = (unsigned char *) mac; 924 iap = (unsigned char *) mac;
926 } 925 }
927 } 926 }
928#endif
929 927
930 /* 928 /*
931 * 3) from flash or fuse (via platform data) 929 * 3) from flash or fuse (via platform data)
@@ -1679,16 +1677,6 @@ static int fec_enet_init(struct net_device *ndev)
1679} 1677}
1680 1678
1681#ifdef CONFIG_OF 1679#ifdef CONFIG_OF
1682static int fec_get_phy_mode_dt(struct platform_device *pdev)
1683{
1684 struct device_node *np = pdev->dev.of_node;
1685
1686 if (np)
1687 return of_get_phy_mode(np);
1688
1689 return -ENODEV;
1690}
1691
1692static void fec_reset_phy(struct platform_device *pdev) 1680static void fec_reset_phy(struct platform_device *pdev)
1693{ 1681{
1694 int err, phy_reset; 1682 int err, phy_reset;
@@ -1717,11 +1705,6 @@ static void fec_reset_phy(struct platform_device *pdev)
1717 gpio_set_value(phy_reset, 1); 1705 gpio_set_value(phy_reset, 1);
1718} 1706}
1719#else /* CONFIG_OF */ 1707#else /* CONFIG_OF */
1720static int fec_get_phy_mode_dt(struct platform_device *pdev)
1721{
1722 return -ENODEV;
1723}
1724
1725static void fec_reset_phy(struct platform_device *pdev) 1708static void fec_reset_phy(struct platform_device *pdev)
1726{ 1709{
1727 /* 1710 /*
@@ -1780,7 +1763,7 @@ fec_probe(struct platform_device *pdev)
1780 1763
1781 platform_set_drvdata(pdev, ndev); 1764 platform_set_drvdata(pdev, ndev);
1782 1765
1783 ret = fec_get_phy_mode_dt(pdev); 1766 ret = of_get_phy_mode(pdev->dev.of_node);
1784 if (ret < 0) { 1767 if (ret < 0) {
1785 pdata = pdev->dev.platform_data; 1768 pdata = pdev->dev.platform_data;
1786 if (pdata) 1769 if (pdata)