Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2220943a authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

phy: Centralise print about attached phy



Many Ethernet drivers contain the same netdev_info() print statement
about the attached phy. Move it into the phy device code. Additionally
add a varargs function which can be used to append additional
information.

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 053e7e16
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -444,9 +444,7 @@ static int mii_probe(struct net_device *dev, int phy_mode)
	lp->old_duplex = -1;
	lp->phydev = phydev;

	pr_info("attached PHY driver [%s] "
	        "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)@sclk=%dMHz)\n",
		phydev->drv->name, phydev_name(phydev), phydev->irq,
	phy_attached_print(phydev, "mdc_clk=%dHz(mdc_div=%d)@sclk=%dMHz)\n",
			   MDC_CLK, mdc_div, sclk / 1000000);

	return 0;
+1 −3
Original line number Diff line number Diff line
@@ -3289,9 +3289,7 @@ static int et131x_mii_probe(struct net_device *netdev)
	phydev->autoneg = AUTONEG_ENABLE;
	adapter->phydev = phydev;

	dev_info(&adapter->pdev->dev,
		 "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
		 phydev->drv->name, phydev_name(phydev));
	phy_attached_info(phydev);

	return 0;
}
+1 −3
Original line number Diff line number Diff line
@@ -583,9 +583,7 @@ static int au1000_mii_probe(struct net_device *dev)
	aup->old_duplex = -1;
	aup->phy_dev = phydev;

	netdev_info(dev, "attached PHY driver [%s] "
	       "(mii_bus:phy_addr=%s, irq=%d)\n",
	       phydev->drv->name, phydev_name(phydev), phydev->irq);
	phy_attached_info(phydev);

	return 0;
}
+1 −2
Original line number Diff line number Diff line
@@ -2315,8 +2315,7 @@ static int b44_register_phy_one(struct b44 *bp)
	bp->old_link = 0;
	bp->phy_addr = phydev->addr;

	dev_info(sdev->dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n",
		 phydev->drv->name, phydev_name(phydev));
	phy_attached_info(phydev);

	return 0;

+1 −2
Original line number Diff line number Diff line
@@ -908,8 +908,7 @@ static int bcm_enet_open(struct net_device *dev)
		else
			phydev->advertising &= ~SUPPORTED_Pause;

		dev_info(kdev, "attached PHY at address %d [%s]\n",
			 phydev->addr, phydev->drv->name);
		phy_attached_info(phydev);

		priv->old_link = 0;
		priv->old_duplex = -1;
Loading