diff options
| author | Andrew Lunn <andrew@lunn.ch> | 2015-02-08 20:29:55 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-02-09 17:05:42 -0500 |
| commit | b750f5b4273316b4bb4d0a4a474c1eeaf0833648 (patch) | |
| tree | fb9fde7519561288a42f1bc253710e2525070422 /net/dsa | |
| parent | a4870f79c228d109c1e51df4a899394515271604 (diff) | |
net: dsa: Remove redundant phy_attach()
dsa_slave_phy_setup() finds the phy for the port via device tree and
using of_phy_connect(), or it uses the fall back of taking a phy from
the switch internal mdio bus and calling phy_connect_direct(). Either
way, if a phy is found, phy_attach_direct() is called to attach the
phy to the slave device.
In dsa_slave_create(), a second call to phy_attach() is made. This
results in the warning "PHY already attached". Remove this second,
redundant attaching of the phy.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
| -rw-r--r-- | net/dsa/slave.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 589aafd01fc5..d104ae15836f 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
| @@ -676,18 +676,5 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent, | |||
| 676 | 676 | ||
| 677 | netif_carrier_off(slave_dev); | 677 | netif_carrier_off(slave_dev); |
| 678 | 678 | ||
| 679 | if (p->phy != NULL) { | ||
| 680 | if (ds->drv->get_phy_flags) | ||
| 681 | p->phy->dev_flags |= ds->drv->get_phy_flags(ds, port); | ||
| 682 | |||
| 683 | phy_attach(slave_dev, dev_name(&p->phy->dev), | ||
| 684 | PHY_INTERFACE_MODE_GMII); | ||
| 685 | |||
| 686 | p->phy->autoneg = AUTONEG_ENABLE; | ||
| 687 | p->phy->speed = 0; | ||
| 688 | p->phy->duplex = 0; | ||
| 689 | p->phy->advertising = p->phy->supported | ADVERTISED_Autoneg; | ||
| 690 | } | ||
| 691 | |||
| 692 | return slave_dev; | 679 | return slave_dev; |
| 693 | } | 680 | } |
