diff mbox

[U-Boot,v2,3/3] net: phy: Test previous phydev->dev against new mac dev

Message ID 1444277971-31252-3-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Bin Meng Oct. 8, 2015, 4:19 a.m. UTC
In phy_connect_dev(), if the phy device has an accociated mac device
before, a warning message will be printed. But we should test the
old device against the new one, if they are actually the same one,
don't print the warning message.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

---

Changes in v2: None

 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Hershberger Oct. 29, 2015, 7:29 p.m. UTC | #1
On Wed, Oct 7, 2015 at 11:19 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> In phy_connect_dev(), if the phy device has an accociated mac device
> before, a warning message will be printed. But we should test the
> old device against the new one, if they are actually the same one,
> don't print the warning message.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot-net/master, thanks!
-Joe
diff mbox

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index d0b3e85..d7364ff 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -789,7 +789,7 @@  void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev)
 {
 	/* Soft Reset the PHY */
 	phy_reset(phydev);
-	if (phydev->dev) {
+	if (phydev->dev && phydev->dev != dev) {
 		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
 				phydev->bus->name, phydev->addr,
 				phydev->dev->name, dev->name);