diff options
author | David S. Miller <davem@davemloft.net> | 2009-07-23 22:03:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-23 22:03:51 -0400 |
commit | 74d154189d597b91da4322996dbf4f5c3d1544ab (patch) | |
tree | 6f09861b5e2f875d2d8ea2127b16add9103221c6 /drivers/net/ucc_geth.c | |
parent | 5a6338db37885af06760d40cad589316e48431e9 (diff) | |
parent | ffafa60d496f80c250f2ae0340ae94434c0b0b4d (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwmc3200wifi/netdev.c
net/wireless/scan.c
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index ca476a58087c..52a6750b8201 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -1591,13 +1591,13 @@ static int init_phy(struct net_device *dev) | |||
1591 | priv->oldspeed = 0; | 1591 | priv->oldspeed = 0; |
1592 | priv->oldduplex = -1; | 1592 | priv->oldduplex = -1; |
1593 | 1593 | ||
1594 | if (!ug_info->phy_node) | ||
1595 | return 0; | ||
1596 | |||
1597 | phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, | 1594 | phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, |
1598 | priv->phy_interface); | 1595 | priv->phy_interface); |
1596 | if (!phydev) | ||
1597 | phydev = of_phy_connect_fixed_link(dev, &adjust_link, | ||
1598 | priv->phy_interface); | ||
1599 | if (!phydev) { | 1599 | if (!phydev) { |
1600 | printk("%s: Could not attach to PHY\n", dev->name); | 1600 | dev_err(&dev->dev, "Could not attach to PHY\n"); |
1601 | return -ENODEV; | 1601 | return -ENODEV; |
1602 | } | 1602 | } |
1603 | 1603 | ||
@@ -3624,9 +3624,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3624 | struct ucc_geth_private *ugeth = NULL; | 3624 | struct ucc_geth_private *ugeth = NULL; |
3625 | struct ucc_geth_info *ug_info; | 3625 | struct ucc_geth_info *ug_info; |
3626 | struct resource res; | 3626 | struct resource res; |
3627 | struct device_node *phy; | ||
3628 | int err, ucc_num, max_speed = 0; | 3627 | int err, ucc_num, max_speed = 0; |
3629 | const u32 *fixed_link; | ||
3630 | const unsigned int *prop; | 3628 | const unsigned int *prop; |
3631 | const char *sprop; | 3629 | const char *sprop; |
3632 | const void *mac_addr; | 3630 | const void *mac_addr; |
@@ -3724,15 +3722,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3724 | 3722 | ||
3725 | ug_info->uf_info.regs = res.start; | 3723 | ug_info->uf_info.regs = res.start; |
3726 | ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); | 3724 | ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); |
3727 | fixed_link = of_get_property(np, "fixed-link", NULL); | 3725 | |
3728 | if (fixed_link) { | 3726 | ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0); |
3729 | phy = NULL; | ||
3730 | } else { | ||
3731 | phy = of_parse_phandle(np, "phy-handle", 0); | ||
3732 | if (phy == NULL) | ||
3733 | return -ENODEV; | ||
3734 | } | ||
3735 | ug_info->phy_node = phy; | ||
3736 | 3727 | ||
3737 | /* Find the TBI PHY node. If it's not there, we don't support SGMII */ | 3728 | /* Find the TBI PHY node. If it's not there, we don't support SGMII */ |
3738 | ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); | 3729 | ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); |
@@ -3741,7 +3732,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3741 | prop = of_get_property(np, "phy-connection-type", NULL); | 3732 | prop = of_get_property(np, "phy-connection-type", NULL); |
3742 | if (!prop) { | 3733 | if (!prop) { |
3743 | /* handle interface property present in old trees */ | 3734 | /* handle interface property present in old trees */ |
3744 | prop = of_get_property(phy, "interface", NULL); | 3735 | prop = of_get_property(ug_info->phy_node, "interface", NULL); |
3745 | if (prop != NULL) { | 3736 | if (prop != NULL) { |
3746 | phy_interface = enet_to_phy_interface[*prop]; | 3737 | phy_interface = enet_to_phy_interface[*prop]; |
3747 | max_speed = enet_to_speed[*prop]; | 3738 | max_speed = enet_to_speed[*prop]; |