From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 09 Nov 2011 13:45:36 +0100 Subject: [U-Boot] [PATCH] arm, davinci_emac: fixup In-Reply-To: References: <1320819979-3861-1-git-send-email-hs@denx.de> <4EBA716C.5000105@denx.de> Message-ID: <4EBA75F0.3040700@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 Lad, Prabhakar Lad wrote: > Hi Heiko, > > On Wed, Nov 9, 2011 at 5:56 PM, Heiko Schocher wrote: > >> Hello Prabhakar Lad, >> >> Prabhakar Lad wrote: >>> Hi Heiko, >>> >>> On Wed, Nov 9, 2011 at 11:56 AM, Heiko Schocher wrote: >> [...] >>>> Signed-off-by: Heiko Schocher >>>> Cc: Sandeep Paulraj >>>> Cc: Albert ARIBAUD >>>> Cc: Wolfgang Denk >>>> Cc: Manjunath Hadli >>>> --- >>>> drivers/net/davinci_emac.c | 17 +++++++++++------ >>>> 1 files changed, 11 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c >>>> index fa31159..a31e9f1 100644 >>>> --- a/drivers/net/davinci_emac.c >>>> +++ b/drivers/net/davinci_emac.c >> [...] >>>> @@ -175,7 +174,13 @@ static int davinci_eth_phy_detect(void) >>>> for (i = 0, j = 0; i < 32; i++) >>>> if (phy_act_state & (1 << i)) { >>>> count++; >>>> - active_phy_addr[j++] = i; >>>> + if (count < MAX_PHY) >>>> + active_phy_addr[j++] = i; >>>> + else { >>>> + printf("%s: to much PHYs detected.\n", >>>> + __func__); >>>> >>> why not make here count = 0 and then break, so that later >>> in davinci_emac_initialize() it wont initializes the phy's >> I prefer here the error printf, because you see immediately what >> is wrong... >> >> Agreed to have a printf, I was suggesting to even have a statement > count = 0; > in that block, if you don't make count zero later > davinci_emac_initialize() function > it will proceed further in initializing the phys , which i believe is > not correct. Ah, Ok, yes, I change this, thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany