diff mbox

[U-Boot] bootp can use mdelay

Message ID 20140711093937.GA4218@amd.pavel.ucw.cz
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Pavel Machek July 11, 2014, 9:39 a.m. UTC
Cleanup bootp code by using mdelay.

Signed-off-by: Pavel Machek <pavel@denx.de>

Comments

Marek Vasut July 11, 2014, 9:43 a.m. UTC | #1
On Friday, July 11, 2014 at 11:39:37 AM, Pavel Machek wrote:
> Cleanup bootp code by using mdelay.

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut
Tom Rini July 22, 2014, 7:22 p.m. UTC | #2
On Fri, Jul 11, 2014 at 11:39:37AM +0200, Pavel Machek wrote:

> Cleanup bootp code by using mdelay.
> 
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Acked-by: Marek Vasut <marex@denx.de>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/net/bootp.c b/net/bootp.c
index 189a003..fdb97cb 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -605,7 +605,7 @@  BootpRequest(void)
 	int extlen, pktlen, iplen;
 	int eth_hdr_size;
 #ifdef CONFIG_BOOTP_RANDOM_DELAY
-	ulong i, rand_ms;
+	ulong rand_ms;
 #endif
 
 	bootstage_mark_name(BOOTSTAGE_ID_BOOTP_START, "bootp_start");
@@ -623,8 +623,7 @@  BootpRequest(void)
 		rand_ms = rand() >> 19;
 
 	printf("Random delay: %ld ms...\n", rand_ms);
-	for (i = 0; i < rand_ms; i++)
-		udelay(1000); /*Wait 1ms*/
+	mdelay(rand_ms);
 
 #endif	/* CONFIG_BOOTP_RANDOM_DELAY */