diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-11-09 10:55:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-11-09 10:55:05 +0100 |
commit | 227426f16163d3721fee82650980aae0eef01375 (patch) | |
tree | a64101906c15b814ec942468e88875ce8160e45d /drivers/net/phy/phy.c | |
parent | c024f90f5dd5604d3f82dbbc055fd88a69d59187 (diff) | |
parent | ac7324a0ed12a67fc836b383388f2562d32e55ed (diff) | |
download | barebox-227426f16163d3721fee82650980aae0eef01375.tar.gz barebox-227426f16163d3721fee82650980aae0eef01375.tar.xz |
Merge branch 'for-next/net-switch-mv88e6xxx'
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 63f249fcff..7c4d14bf4c 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -176,12 +176,12 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id) phydev->dev.bus = &mdio_bus_type; if (bus) { - sprintf(phydev->dev.name, "mdio%d-phy%02x", - phydev->bus->dev.id, - phydev->addr); + dev_set_name(&phydev->dev, "mdio%d-phy%02x", + phydev->bus->dev.id, + phydev->addr); phydev->dev.id = DEVICE_ID_SINGLE; } else { - sprintf(phydev->dev.name, "fixed-phy"); + dev_set_name(&phydev->dev, "fixed-phy"); phydev->dev.id = DEVICE_ID_DYNAMIC; } @@ -234,6 +234,10 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr) u32 phy_id = 0; int r; + /* skip masked out PHY addresses */ + if (bus->phy_mask & BIT(addr)) + return ERR_PTR(-ENODEV); + r = get_phy_id(bus, addr, &phy_id); if (r) return ERR_PTR(r); @@ -444,9 +448,6 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr, } for (i = 0; i < PHY_MAX_ADDR && !edev->phydev; i++) { - /* skip masked out PHY addresses */ - if (bus->phy_mask & (1 << i)) - continue; phy = mdiobus_scan(bus, i); if (IS_ERR(phy)) |