netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dsa: correctly determine the number of switches in a system
@ 2015-02-05 13:54 Tobias Waldekranz
  2015-02-05 19:41 ` Florian Fainelli
  2015-02-08  6:08 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Tobias Waldekranz @ 2015-02-05 13:54 UTC (permalink / raw)
  To: netdev

The number of connected switches was sourced from the number of
children to the DSA node, change it to the number of available
children, skipping any disabled switches.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
 net/dsa/dsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 3731714..2173402 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -603,7 +603,7 @@ static int dsa_of_probe(struct platform_device *pdev)
 
 	pdev->dev.platform_data = pd;
 	pd->netdev = &ethernet_dev->dev;
-	pd->nr_chips = of_get_child_count(np);
+	pd->nr_chips = of_get_available_child_count(np);
 	if (pd->nr_chips > DSA_MAX_SWITCHES)
 		pd->nr_chips = DSA_MAX_SWITCHES;
 
-- 
1.8.4.357.g8d83871.dirty

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

* Re: [PATCH] dsa: correctly determine the number of switches in a system
  2015-02-05 13:54 [PATCH] dsa: correctly determine the number of switches in a system Tobias Waldekranz
@ 2015-02-05 19:41 ` Florian Fainelli
  2015-02-08  6:08 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2015-02-05 19:41 UTC (permalink / raw)
  To: Tobias Waldekranz, netdev

On 05/02/15 05:54, Tobias Waldekranz wrote:
> The number of connected switches was sourced from the number of
> children to the DSA node, change it to the number of available
> children, skipping any disabled switches.
> 
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: 5e95329b701c4 ("dsa: add device tree bindings to register DSA
switches")

> ---
>  net/dsa/dsa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> index 3731714..2173402 100644
> --- a/net/dsa/dsa.c
> +++ b/net/dsa/dsa.c
> @@ -603,7 +603,7 @@ static int dsa_of_probe(struct platform_device *pdev)
>  
>  	pdev->dev.platform_data = pd;
>  	pd->netdev = &ethernet_dev->dev;
> -	pd->nr_chips = of_get_child_count(np);
> +	pd->nr_chips = of_get_available_child_count(np);
>  	if (pd->nr_chips > DSA_MAX_SWITCHES)
>  		pd->nr_chips = DSA_MAX_SWITCHES;
>  
> 


-- 
Florian

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

* Re: [PATCH] dsa: correctly determine the number of switches in a system
  2015-02-05 13:54 [PATCH] dsa: correctly determine the number of switches in a system Tobias Waldekranz
  2015-02-05 19:41 ` Florian Fainelli
@ 2015-02-08  6:08 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-02-08  6:08 UTC (permalink / raw)
  To: tobias; +Cc: netdev

From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 5 Feb 2015 14:54:09 +0100

> The number of connected switches was sourced from the number of
> children to the DSA node, change it to the number of available
> children, skipping any disabled switches.
> 
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>

Applied.

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

end of thread, other threads:[~2015-02-08  6:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 13:54 [PATCH] dsa: correctly determine the number of switches in a system Tobias Waldekranz
2015-02-05 19:41 ` Florian Fainelli
2015-02-08  6:08 ` David Miller

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).