From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 17 Nov 2011 14:04:01 +0100 Subject: [U-Boot] [PATCH] ARM: davici_emac: Fix condition for number of phy detects In-Reply-To: <1321534403-11839-1-git-send-email-prabhakar.csengg@gmail.com> References: <1321534403-11839-1-git-send-email-prabhakar.csengg@gmail.com> Message-ID: <4EC50641.3040307@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello prabhakar.csengg at gmail.com prabhakar.csengg at gmail.com wrote: > From: Prabhakar Lad > > Fix the condition for number of phys in > davinci_eth_phy_detect() function. > CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT indicates number of > phys. From this commit id dc02badab480563b0bf9d3908046ea9d6b22ae63 > davinci emac initilazed one less than the number of phy count. > > Signed-off-by: Prabhakar Lad > --- > drivers/net/davinci_emac.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c > index 36c33af..34b6f94 100644 > --- a/drivers/net/davinci_emac.c > +++ b/drivers/net/davinci_emac.c > @@ -176,7 +176,7 @@ static int davinci_eth_phy_detect(void) > for (i = 0, j = 0; i < 32; i++) > if (phy_act_state & (1 << i)) { > count++; > - if (count < CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT) { > + if (count <= CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT) { > active_phy_addr[j++] = i; > } else { > printf("%s: to many PHYs detected.\n", good catch! Acked-by: Heiko Schocher bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany