From patchwork Mon Mar 26 10:09:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Virdi X-Patchwork-Id: 148688 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 DDDFAB6FB6 for ; Mon, 26 Mar 2012 21:12:37 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 590C928121; Mon, 26 Mar 2012 12:11:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 kROcYlnnC896; Mon, 26 Mar 2012 12:11:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DBDEF28137; Mon, 26 Mar 2012 12:11:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4CB1428108 for ; Mon, 26 Mar 2012 12:10:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 p-Si20yr4SD7 for ; Mon, 26 Mar 2012 12:10:28 +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 eu1sys200aog110.obsmtp.com (eu1sys200aog110.obsmtp.com [207.126.144.129]) by theia.denx.de (Postfix) with ESMTPS id 4EC8C28105 for ; Mon, 26 Mar 2012 12:10:24 +0200 (CEST) Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKT3BAirwUGNQOPuuAYjlv3OR4bheHDC18@postini.com; Mon, 26 Mar 2012 10:10:27 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7D733183; Mon, 26 Mar 2012 10:01:51 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas4.st.com [10.80.176.69]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B7D2F1670; Mon, 26 Mar 2012 10:10:15 +0000 (GMT) Received: from localhost (10.199.7.86) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.192.1; Mon, 26 Mar 2012 18:09:20 +0800 From: Amit Virdi To: Date: Mon, 26 Mar 2012 15:39:54 +0530 Message-ID: <1332756599-19304-4-git-send-email-amit.virdi@st.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: <1332756599-19304-1-git-send-email-amit.virdi@st.com> References: <1332756599-19304-1-git-send-email-amit.virdi@st.com> MIME-Version: 1.0 Cc: Amit Virdi , sr@denx.de, spear-devel@list.st.com Subject: [U-Boot] [PATCH V2 3/8] net/designware: Phy address fix X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Vipin KUMAR The code assumes the phy address to be > 0, which is not true, the phy address can be in the range 0-31. Signed-off-by: Vipin Kumar Signed-off-by: Amit Virdi --- drivers/net/designware.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index ea8a406..fc14b70 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -384,7 +384,7 @@ static int configure_phy(struct eth_device *dev) #if defined(CONFIG_DW_SEARCH_PHY) phy_addr = find_phy(dev); - if (phy_addr > 0) + if (phy_addr >= 0) priv->address = phy_addr; else return -1;