mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 02:21:47 +00:00
net: ethernet: ixp4xx: Retire ancient phy retrieveal
This driver was using a really dated way of obtaining the phy by printing a string and using it with phy_connect(). Switch to using more reasonable modern interfaces. Suggested-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
48ac0b5805
commit
3e8047a985
@ -1360,7 +1360,6 @@ static const struct net_device_ops ixp4xx_netdev_ops = {
|
|||||||
|
|
||||||
static int ixp4xx_eth_probe(struct platform_device *pdev)
|
static int ixp4xx_eth_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
char phy_id[MII_BUS_ID_SIZE + 3];
|
|
||||||
struct phy_device *phydev = NULL;
|
struct phy_device *phydev = NULL;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct eth_plat_info *plat;
|
struct eth_plat_info *plat;
|
||||||
@ -1459,14 +1458,15 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
|
|||||||
__raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control);
|
__raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control);
|
||||||
udelay(50);
|
udelay(50);
|
||||||
|
|
||||||
snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
|
phydev = mdiobus_get_phy(mdio_bus, plat->phy);
|
||||||
mdio_bus->id, plat->phy);
|
|
||||||
phydev = phy_connect(ndev, phy_id, &ixp4xx_adjust_link,
|
|
||||||
PHY_INTERFACE_MODE_MII);
|
|
||||||
if (IS_ERR(phydev)) {
|
if (IS_ERR(phydev)) {
|
||||||
err = PTR_ERR(phydev);
|
err = PTR_ERR(phydev);
|
||||||
goto err_free_mem;
|
goto err_free_mem;
|
||||||
}
|
}
|
||||||
|
err = phy_connect_direct(ndev, phydev, ixp4xx_adjust_link,
|
||||||
|
PHY_INTERFACE_MODE_MII);
|
||||||
|
if (err)
|
||||||
|
goto err_free_mem;
|
||||||
|
|
||||||
phydev->irq = PHY_POLL;
|
phydev->irq = PHY_POLL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user