Re: [U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

2009-08-20 Thread Simon Kagstrom
On Wed, 19 Aug 2009 10:08:02 -0700 Ben Warren wrote: > > - u16 phyadr; > > - miiphy_read(dev->name, 0xEE, 0xEE, &phyadr); > > - if (!miiphy_link(dev->name, phyadr)) { > > - printf("%s: No link on %s\n", __FUNCTION__, dev->name); > > > Please use __func__ instead. It's defined

Re: [U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

2009-08-19 Thread Wolfgang Denk
Dear Ben Warren, In message <4a8c5288.5020...@gmail.com> you wrote: > > >>> + /* Wait up to 5s for the link status */ > >>> + for (i = 0; i < 5; i++) { > >>> + u16 phyadr; > >>> > >> Please put this variable declaration outside of the 'for' loop > >> > > > > Why? If it's only u

Re: [U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

2009-08-19 Thread Ben Warren
Wolfgang Denk wrote: > Dear Ben Warren, > > > >>> + /* Wait up to 5s for the link status */ >>> + for (i = 0; i < 5; i++) { >>> + u16 phyadr; >>> >>> >> Please put this variable declaration outside of the 'for' loop >> > > Why? If it's only used in this block it's a

Re: [U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

2009-08-19 Thread Wolfgang Denk
Dear Ben Warren, In message <4a8c3172.70...@gmail.com> you wrote: > > > - if (!miiphy_link(dev->name, phyadr)) { > > - printf("%s: No link on %s\n", __FUNCTION__, dev->name); > > > Please use __func__ instead. It's defined in C99, while __FUNCTION__ > isn't (or so I've read) Do

Re: [U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

2009-08-19 Thread Ben Warren
Simon, Simon Kagstrom wrote: > Wait for the link to come up on kirkwood network init > > This patch makes the device wait for up to 5 seconds for the link to > come up, similar to what many of the other network drivers do. This > avoids confusing situations where, e.g., a tftp fails when initiated

[U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

2009-08-19 Thread Simon Kagstrom
Wait for the link to come up on kirkwood network init This patch makes the device wait for up to 5 seconds for the link to come up, similar to what many of the other network drivers do. This avoids confusing situations where, e.g., a tftp fails when initiated early after U-boot has started (before