From patchwork Fri Sep 4 11:56:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 514399 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B7DAD1402A3 for ; Fri, 4 Sep 2015 21:54:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=I2XnmvZl; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8B4FC4B7C4; Fri, 4 Sep 2015 13:54:49 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s3jP37Q7uXqd; Fri, 4 Sep 2015 13:54:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8FEAD4B7BD; Fri, 4 Sep 2015 13:54:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0CDEC4B764 for ; Fri, 4 Sep 2015 13:54:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 52unjK2-Aynq for ; Fri, 4 Sep 2015 13:54:36 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by theia.denx.de (Postfix) with ESMTPS id 896824B74D for ; Fri, 4 Sep 2015 13:54:32 +0200 (CEST) Received: by pacwi10 with SMTP id wi10so22659919pac.3 for ; Fri, 04 Sep 2015 04:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uPIYR9vT4yIlv7OGOAgw2hamzbhLc1N9B15MzGuPAbo=; b=I2XnmvZlE6vgdk52dUy2pDK+jxA5xmbPBfIZEKrZ3KT2O5TYKVx2emmJpBeTypK/T2 EHP784f/bq2/VS9bjV7Qjy9ys8u0PdctBM4bLze7eekOqDSPwv+1K4wzmsH68otBYpub v5lOsGr1B9LUsl7iaTygMcpQ2FzckYFutMbzTsMxxlMaWpvhajLyDNJYRho9ryLjAFAu 2z2SvMc6bnPlelZOxVJ6w0vtsOjM69wmaj3gajVRGLUcIesIH2lNnMQASVhKeNqAqYvc uLDxeGrbUJ6LMXjLCpsbJJAHfGrKVQ6cNakW9QtAgphpNYxZ6SVpEOZny+kf04u3VoyV qsIw== X-Received: by 10.68.226.134 with SMTP id rs6mr7559487pbc.11.1441367671700; Fri, 04 Sep 2015 04:54:31 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id kv10sm2304640pbc.2.2015.09.04.04.54.31 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Sep 2015 04:54:31 -0700 (PDT) From: Bin Meng To: Joe Hershberger , U-Boot Mailing List Date: Fri, 4 Sep 2015 04:56:52 -0700 Message-Id: <1441367812-26899-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1441367812-26899-1-git-send-email-bmeng.cn@gmail.com> References: <1441367812-26899-1-git-send-email-bmeng.cn@gmail.com> Cc: Ivan Khoronzhuk , Tom Rini Subject: [U-Boot] [PATCH 3/3] net: phy: Test previous phydev->dev against new mac dev X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Acked-by: Joe Hershberger --- drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 651e456..35dfcc1 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);