All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
@ 2017-10-26  0:32 Florian Fainelli
  2017-10-26  1:21 ` Vivien Didelot
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Florian Fainelli @ 2017-10-26  0:32 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, mnhu, Florian Fainelli

Remove the code that tried to identify if a PHY designated by Device
Tree required diversion through the DSA-created MDIO bus. This was
created mainly for the bcm_sf2.c driver back when it did not have its
own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
bcm_sf2: Register our slave MDIO bus").

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/dsa/slave.c | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index d0ae7010ea45..808e205227c3 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1060,28 +1060,10 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
 		phy_flags = ds->ops->get_phy_flags(ds, dp->index);
 
 	if (phy_dn) {
-		int phy_id = of_mdio_parse_addr(&slave_dev->dev, phy_dn);
-
-		/* If this PHY address is part of phys_mii_mask, which means
-		 * that we need to divert reads and writes to/from it, then we
-		 * want to bind this device using the slave MII bus created by
-		 * DSA to make that happen.
-		 */
-		if (!phy_is_fixed && phy_id >= 0 &&
-		    (ds->phys_mii_mask & (1 << phy_id))) {
-			ret = dsa_slave_phy_connect(slave_dev, phy_id);
-			if (ret) {
-				netdev_err(slave_dev, "failed to connect to phy%d: %d\n", phy_id, ret);
-				of_node_put(phy_dn);
-				return ret;
-			}
-		} else {
-			slave_dev->phydev = of_phy_connect(slave_dev, phy_dn,
-							   dsa_slave_adjust_link,
-							   phy_flags,
-							   p->phy_interface);
-		}
-
+		slave_dev->phydev = of_phy_connect(slave_dev, phy_dn,
+						   dsa_slave_adjust_link,
+						   phy_flags,
+						   p->phy_interface);
 		of_node_put(phy_dn);
 	}
 
-- 
2.9.3

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

* Re: [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
  2017-10-26  0:32 [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup() Florian Fainelli
@ 2017-10-26  1:21 ` Vivien Didelot
  2017-10-26  7:19 ` Andrew Lunn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Vivien Didelot @ 2017-10-26  1:21 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: davem, andrew, mnhu, Florian Fainelli

Florian Fainelli <f.fainelli@gmail.com> writes:

> Remove the code that tried to identify if a PHY designated by Device
> Tree required diversion through the DSA-created MDIO bus. This was
> created mainly for the bcm_sf2.c driver back when it did not have its
> own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
> bcm_sf2: Register our slave MDIO bus").
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

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

* Re: [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
  2017-10-26  0:32 [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup() Florian Fainelli
  2017-10-26  1:21 ` Vivien Didelot
@ 2017-10-26  7:19 ` Andrew Lunn
  2017-10-26 11:07 ` Martin Hundebøll
  2017-10-27 13:11 ` David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2017-10-26  7:19 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, davem, vivien.didelot, mnhu

On Wed, Oct 25, 2017 at 05:32:05PM -0700, Florian Fainelli wrote:
> Remove the code that tried to identify if a PHY designated by Device
> Tree required diversion through the DSA-created MDIO bus. This was
> created mainly for the bcm_sf2.c driver back when it did not have its
> own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
> bcm_sf2: Register our slave MDIO bus").
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks for the cleanup.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
  2017-10-26  0:32 [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup() Florian Fainelli
  2017-10-26  1:21 ` Vivien Didelot
  2017-10-26  7:19 ` Andrew Lunn
@ 2017-10-26 11:07 ` Martin Hundebøll
  2017-10-26 16:45   ` Florian Fainelli
  2017-10-27 13:11 ` David Miller
  3 siblings, 1 reply; 7+ messages in thread
From: Martin Hundebøll @ 2017-10-26 11:07 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: davem, andrew, vivien.didelot

On 2017-10-26 02:32, Florian Fainelli wrote:
> Remove the code that tried to identify if a PHY designated by Device
> Tree required diversion through the DSA-created MDIO bus. This was
> created mainly for the bcm_sf2.c driver back when it did not have its
> own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
> bcm_sf2: Register our slave MDIO bus").
> 
> Signed-off-by: Florian Fainelli<f.fainelli@gmail.com>

Tested-by: Martin Hundebøll <mnhu@prevas.dk>


Thanks,
Martin

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

* Re: [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
  2017-10-26 11:07 ` Martin Hundebøll
@ 2017-10-26 16:45   ` Florian Fainelli
  2017-10-27  5:02     ` Martin Hundebøll
  0 siblings, 1 reply; 7+ messages in thread
From: Florian Fainelli @ 2017-10-26 16:45 UTC (permalink / raw)
  To: Martin Hundebøll, netdev; +Cc: davem, andrew, vivien.didelot

On 10/26/2017 04:07 AM, Martin Hundebøll wrote:
> On 2017-10-26 02:32, Florian Fainelli wrote:
>> Remove the code that tried to identify if a PHY designated by Device
>> Tree required diversion through the DSA-created MDIO bus. This was
>> created mainly for the bcm_sf2.c driver back when it did not have its
>> own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
>> bcm_sf2: Register our slave MDIO bus").
>>
>> Signed-off-by: Florian Fainelli<f.fainelli@gmail.com>
> 
> Tested-by: Martin Hundebøll <mnhu@prevas.dk>

Thanks Martin, does that correctly fix the problem you reported a week
ago on 639X?
-- 
Florian

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

* Re: [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
  2017-10-26 16:45   ` Florian Fainelli
@ 2017-10-27  5:02     ` Martin Hundebøll
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Hundebøll @ 2017-10-27  5:02 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: davem, andrew, vivien.didelot

On 2017-10-26 18:45, Florian Fainelli wrote:
> On 10/26/2017 04:07 AM, Martin Hundebøll wrote:
>> On 2017-10-26 02:32, Florian Fainelli wrote:
>>> Remove the code that tried to identify if a PHY designated by Device
>>> Tree required diversion through the DSA-created MDIO bus. This was
>>> created mainly for the bcm_sf2.c driver back when it did not have its
>>> own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
>>> bcm_sf2: Register our slave MDIO bus").
>>>
>>> Signed-off-by: Florian Fainelli<f.fainelli@gmail.com>
>> Tested-by: Martin Hundebøll<mnhu@prevas.dk>
> Thanks Martin, does that correctly fix the problem you reported a week
> ago on 639X?

It does indeed. Thanks for the work on this.

// Martin

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

* Re: [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup()
  2017-10-26  0:32 [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup() Florian Fainelli
                   ` (2 preceding siblings ...)
  2017-10-26 11:07 ` Martin Hundebøll
@ 2017-10-27 13:11 ` David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2017-10-27 13:11 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, mnhu

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 25 Oct 2017 17:32:05 -0700

> Remove the code that tried to identify if a PHY designated by Device
> Tree required diversion through the DSA-created MDIO bus. This was
> created mainly for the bcm_sf2.c driver back when it did not have its
> own MDIO bus driver, which it now has since 461cd1b03e32 ("net: dsa:
> bcm_sf2: Register our slave MDIO bus").
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied.

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

end of thread, other threads:[~2017-10-27 13:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  0:32 [PATCH net-next] net: dsa: Simplify dsa_slave_phy_setup() Florian Fainelli
2017-10-26  1:21 ` Vivien Didelot
2017-10-26  7:19 ` Andrew Lunn
2017-10-26 11:07 ` Martin Hundebøll
2017-10-26 16:45   ` Florian Fainelli
2017-10-27  5:02     ` Martin Hundebøll
2017-10-27 13:11 ` David Miller

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.