netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fw: [PATCH] ucc_geth: Correct fixed_link OOPS.
@ 2009-03-20 19:43 Joakim Tjernlund
  2009-03-20 20:07 ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: Joakim Tjernlund @ 2009-03-20 19:43 UTC (permalink / raw)
  To: leoli, netdev, linuxppc-dev

hmm, this mail didn't seem to reach the lists. Resending

 Jocke
----- Forwarded by Joakim Tjernlund/Transmode on 20/03/2009 20:42 -----

From:
Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
To:
leoli@freescale.com, netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc:
Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date:
20/03/2009 18:01
Subject:
[PATCH] ucc_geth: Correct fixed_link OOPS.



fixed_link(PHY less) mode will get you an NULL
deference as it does not have a phy-handle.
Correct by using already probed information.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---

The below fixes the problem and seems like the right thing to do.
Can we have this in 2.6.29?

 drivers/net/ucc_geth.c |   17 +----------------
 1 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index dc2f8f2..12e5c3d 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1536,11 +1536,6 @@ static void adjust_link(struct net_device *dev)
 static int init_phy(struct net_device *dev)
 {
                 struct ucc_geth_private *priv = netdev_priv(dev);
-                struct device_node *np = priv->node;
-                struct device_node *phy, *mdio;
-                const phandle *ph;
-                char bus_name[MII_BUS_ID_SIZE];
-                const unsigned int *id;
                 struct phy_device *phydev;
                 char phy_id[BUS_ID_SIZE];
 
@@ -1548,18 +1543,8 @@ static int init_phy(struct net_device *dev)
                 priv->oldspeed = 0;
                 priv->oldduplex = -1;
 
-                ph = of_get_property(np, "phy-handle", NULL);
-                phy = of_find_node_by_phandle(*ph);
-                mdio = of_get_parent(phy);
-
-                id = of_get_property(phy, "reg", NULL);
-
-                of_node_put(phy);
-                of_node_put(mdio);
-
-                uec_mdio_bus_name(bus_name, mdio);
                 snprintf(phy_id, sizeof(phy_id), "%s:%02x",
-                                bus_name, *id);
+                                 priv->ug_info->mdio_bus, 
priv->ug_info->phy_address);
 
                 phydev = phy_connect(dev, phy_id, &adjust_link, 0, 
priv->phy_interface);
 
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-20 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-20 19:43 Fw: [PATCH] ucc_geth: Correct fixed_link OOPS Joakim Tjernlund
2009-03-20 20:07 ` Anton Vorontsov
2009-03-20 20:46   ` Joakim Tjernlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).