aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-08-08 06:25:28 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-08-08 06:26:15 -0400
commita131bc185528331451a93db6c50a7d2070376a61 (patch)
tree18cccd206d4835ee8df147ac3b0c0e30cc00680d /drivers/net/gianfar.c
parent19943b0e30b05d42e494ae6fef78156ebc8c637e (diff)
parentff1649ff780fb7c0bfbf42d05ffc9b56336b9aa3 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Pull fixes in from 2.6.31 so that people testing the iommu-2.6.git tree no longer trip over bugs which were already fixed (sorry, Horms).
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 4ae1d259fce..f8ffcbf0bc3 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -156,6 +156,8 @@ static const struct net_device_ops gfar_netdev_ops = {
156 .ndo_tx_timeout = gfar_timeout, 156 .ndo_tx_timeout = gfar_timeout,
157 .ndo_do_ioctl = gfar_ioctl, 157 .ndo_do_ioctl = gfar_ioctl,
158 .ndo_vlan_rx_register = gfar_vlan_rx_register, 158 .ndo_vlan_rx_register = gfar_vlan_rx_register,
159 .ndo_set_mac_address = eth_mac_addr,
160 .ndo_validate_addr = eth_validate_addr,
159#ifdef CONFIG_NET_POLL_CONTROLLER 161#ifdef CONFIG_NET_POLL_CONTROLLER
160 .ndo_poll_controller = gfar_netpoll, 162 .ndo_poll_controller = gfar_netpoll,
161#endif 163#endif
@@ -262,15 +264,6 @@ static int gfar_of_init(struct net_device *dev)
262 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET; 264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
263 265
264 priv->phy_node = of_parse_phandle(np, "phy-handle", 0); 266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
265 if (!priv->phy_node) {
266 u32 *fixed_link;
267
268 fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
269 if (!fixed_link) {
270 err = -ENODEV;
271 goto err_out;
272 }
273 }
274 267
275 /* Find the TBI PHY. If it's not there, we don't support SGMII */ 268 /* Find the TBI PHY. If it's not there, we don't support SGMII */
276 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 269 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -657,13 +650,14 @@ static int init_phy(struct net_device *dev)
657 650
658 interface = gfar_get_interface(dev); 651 interface = gfar_get_interface(dev);
659 652
660 if (priv->phy_node) { 653 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
661 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 654 interface);
662 0, interface); 655 if (!priv->phydev)
663 if (!priv->phydev) { 656 priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
664 dev_err(&dev->dev, "error: Could not attach to PHY\n"); 657 interface);
665 return -ENODEV; 658 if (!priv->phydev) {
666 } 659 dev_err(&dev->dev, "could not attach to PHY\n");
660 return -ENODEV;
667 } 661 }
668 662
669 if (interface == PHY_INTERFACE_MODE_SGMII) 663 if (interface == PHY_INTERFACE_MODE_SGMII)