linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: avorontsov@ru.mvista.com
Cc: linuxppc-dev@ozlabs.org, jgarzik@pobox.com,
	afleming@freescale.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 5/5] net: make mpc5200 fec driver use of_mdio infrastructure
Date: Wed, 18 Mar 2009 22:35:14 -0600	[thread overview]
Message-ID: <fa686aa40903182135v51bbeafahc7fa899fb454a312@mail.gmail.com> (raw)
In-Reply-To: <20090310202949.GA17184@oksana.dev.rtsoft.ru>

On Tue, Mar 10, 2009 at 2:29 PM, Anton Vorontsov
<avorontsov@ru.mvista.com> wrote:
> On Tue, Mar 10, 2009 at 01:48:26PM -0600, Grant Likely wrote:
>> Regardless, I
>> think all the drivers should be using common code for obtaining the
>> phy_device from the device tree.
>
> Not necessary `struct phy_device'. All we need is some common
> routine for translating PHY's "mdio_node->full_name + phy id" to
> phy_bus_id.

This only works if the network driver knows how the MDIO bus is named.
 The current code assumes that the MDIO bus name is the register
address, but this is a driver implementation detail and MDIO bus
drivers can deviate from this.  What about MDIO busses that don't have
a reg property?  For example, fs_enet/mii-bitbang.c sets the bus name
to "CPM2 Bitbanged MII".  There is no one-size-fits-all way to figure
out the phy bus id from the ethernet driver side of things.

The sure and simple way to guarantee a match between the PHY device
node and the phy_device is to use the PHY device_node pointer itself
as the search key.

I concede that my first attempt at this was overly complex, but I've
reworked the code and I think it makes thinks considerably simpler.
I'll post a new series tomorrow.  I've got patches to make the
ucc_eth, gianfar and fs_enet drivers to use the device_node method
also.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

      reply	other threads:[~2009-03-19  4:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 15:21 [PATCH 0/5] Retrieving Ethernet PHY wireup from the OF device tree Grant Likely
2009-03-10 15:22 ` [PATCH 1/5] drivers/base: Add bus_register_notifier_alldev() variant Grant Likely
2009-03-10 15:22 ` [PATCH 2/5] phylib: rework to prepare for OF registration of PHYs Grant Likely
2009-03-10 15:22 ` [PATCH 3/5] phylib: add *_direct() variants of phy_connect and phy_attach functions Grant Likely
2009-03-10 15:22 ` [PATCH 4/5] openfirmware: Add OF phylib support code Grant Likely
2009-03-10 15:22 ` [PATCH 5/5] net: make mpc5200 fec driver use of_mdio infrastructure Grant Likely
2009-03-10 19:16   ` Anton Vorontsov
2009-03-10 19:48     ` Grant Likely
2009-03-10 20:29       ` Anton Vorontsov
2009-03-19  4:35         ` Grant Likely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa686aa40903182135v51bbeafahc7fa899fb454a312@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=afleming@freescale.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).