All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: Timur Tabi <timur@freescale.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>
Cc: david.daney@cavium.com, David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>
Subject: Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
Date: Tue, 07 Aug 2012 09:59:25 -0700	[thread overview]
Message-ID: <5021496D.8070200@gmail.com> (raw)
In-Reply-To: <1344358266-5450-1-git-send-email-timur@freescale.com>

On 08/07/2012 09:51 AM, Timur Tabi wrote:
> The mdio-mux driver scans all child mdio nodes, without regard to whether
> the node is actually used.  Some device trees include all possible
> mdio-mux nodes and rely on the boot loader to disable those that are not
> present, based on some run-time configuration.  Those nodes need to be
> skipped.
>
> Signed-off-by: Timur Tabi<timur@freescale.com>
> ---
>   drivers/net/phy/mdio-mux.c |    9 +++++++++
>   1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
> index 5c12018..d0c231e 100644
> --- a/drivers/net/phy/mdio-mux.c
> +++ b/drivers/net/phy/mdio-mux.c
> @@ -135,6 +135,15 @@ int mdio_mux_init(struct device *dev,
>   	for_each_child_of_node(dev->of_node, child_bus_node) {
>   		u32 v;
>
> +		/*
> +		 * Some device trees include all possible mdio-mux nodes and
> +		 * rely on the boot loader to disable those that are not
> +		 * present, based on some run-time configuration.  Those nodes
> +		 * need to be skipped.
> +		 */
> +		if (!of_device_is_available(child_bus_node))
> +			continue;


Although this will get the job done, I don't think it is the cleanest 
approach.

Would it be better to create a new iterator 
(for_each_available_child_of_node perhaps) that skips the unavailable 
nodes?  This seems like a general problem that is not restricted to mdio 
multiplexers.

David Daney

  reply	other threads:[~2012-08-07 16:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 16:51 [PATCH] netdev/phy: skip disabled mdio-mux nodes Timur Tabi
2012-08-07 16:59 ` David Daney [this message]
     [not found]   ` <5021496D.8070200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-07 17:04     ` Timur Tabi
2012-08-14 19:19 ` Tabi Timur-B04825
2012-08-14 21:07   ` David Miller
2012-08-14 21:12     ` Timur Tabi
2012-08-14 21:16       ` David Miller

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=5021496D.8070200@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=netdev@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=timur@freescale.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.