[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fa686aa40904172334g2c989765u3ae9c3e50b7ad5c4@mail.gmail.com>
Date: Sat, 18 Apr 2009 00:34:05 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: Andy Fleming <afleming@...escale.com>
Cc: netdev@...r.kernel.org, linuxppc-dev@...abs.org, olof@...om.net,
galak@...nel.crashing.org,
Anton Vorontsov <avorontsov@...mvista.com>,
Joakim Tjernlund <Joakim.Tjernlund@...nsmode.se>
Subject: Re: [PATCH 09/14] net: Rework gianfar driver to use of_mdio
infrastructure.
On Wed, Apr 15, 2009 at 5:01 PM, Andy Fleming <afleming@...escale.com> wrote:
>
> On Mar 31, 2009, at 3:27 AM, Grant Likely wrote:
>
>> From: Grant Likely <grant.likely@...retlab.ca>
>>
>> This patch simplifies the driver by making use of more common code.
>>
>> Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
>> ---
>>
>> drivers/net/gianfar.c | 103
>> ++++++++++++++++++-------------------------------
>> drivers/net/gianfar.h | 3 +
>> 2 files changed, 40 insertions(+), 66 deletions(-)
>>
>>
>> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
>> index 65f5587..c22eba9 100644
>> @@ -699,23 +657,38 @@ static int init_phy(struct net_device *dev)
>>
>>
>> + if (priv->tbi_node) {
>> + priv->tbiphy = of_phy_connect(dev, priv->tbi_node,
>> &adjust_link,
>> + 0, interface);
>> + if (!priv->tbiphy) {
>> + dev_err(&dev->dev, "error: Could not attach to
>> TBI\n");
>> + goto err_tbiphy;
>> + }
>> + }
>
> I don't believe we need this. Certainly, the current code doesn't do
> anything like this. The TBI node is a special internal PHY used to manage
> SGMII/TBI links.
Actually, it does. gianfar_of_init() used to parse the tbi-handle,
and I've replaced that code with a call to of_parse_phandle() in init
and an of_phy_connect() in init_phy() to get a pointer to the TBI
phy_device. However, you are completely right that calling
of_phy_connect() is entirely the wrong thing to do on the TBI phy. It
should be retrieving the pointer to the phydevice without actually
connecting to it (which forces the phy_driver probe and starts the
state machine). I need to fix this.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists