Skip to contentSkip to conversation

r6040: fix bad usage of udelay

PATCH RESEND Applied Florian Fainelli 2 participants 2 messages Sep 3, 2008 – Sep 13, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 r6040: fix bad usage of udelay

Hi Francois, Jeff,

This patch applies to the patch sent previously entitled :
[PATCH] r6040: remove unused includes.

Thanks.
--
From: Florian Fainelli <[email protected]>
Subject: [PATCH resend] r6040: fix bad usage of udelay

This patch fixes the bad usage of udelay(5000), which in turns is a mdelay(5). It causes compilation for ARM where udelay maximum value is checked.

---

drivers/net/r6040.c +2 -2
index d453987..d837bef 100644
@@ -364,7 +364,7 @@ static void r6040_init_mac_regs(struct net_device *dev)
 	/* Reset internal state machine */
 	iowrite16(2, ioaddr + MAC_SM);
 	iowrite16(0, ioaddr + MAC_SM);
-	udelay(5000);
+	mdelay(5);
 
 	/* MAC Bus Control Register */
 	iowrite16(MBCR_DEFAULT, ioaddr + MBCR);
@@ -800,7 +800,7 @@ static void r6040_mac_address(struct net_device *dev)
 	iowrite16(0x01, ioaddr + MCR1); /* Reset MAC */
 	iowrite16(2, ioaddr + MAC_SM); /* Reset internal state machine */
 	iowrite16(0, ioaddr + MAC_SM);
-	udelay(5000);
+	mdelay(5);
 
 	/* Restore MAC Address */
 	adrp = (u16 *) dev->dev_addr;
Applied
#1 lore raw
Quoted 31 lines · Florian Fainelli

Hi Francois, Jeff,

This patch applies to the patch sent previously entitled :
[PATCH] r6040: remove unused includes.

Thanks.
--
From: Florian Fainelli <[email protected]>
Subject: [PATCH resend] r6040: fix bad usage of udelay

This patch fixes the bad usage of udelay(5000), which in turns is a mdelay(5). It causes compilation for ARM where udelay maximum value is checked.

---

drivers/net/r6040.c +1 -1
index d453987..d837bef 100644
@@ -364,7 +364,7 @@ static void r6040_init_mac_regs(struct net_device *dev)
 	/* Reset internal state machine */
 	iowrite16(2, ioaddr + MAC_SM);
 	iowrite16(0, ioaddr + MAC_SM);
-	udelay(5000);
+	mdelay(5);
 
 	/* MAC Bus Control Register */
 	iowrite16(MBCR_DEFAULT, ioaddr + MBCR);

drivers/net/r6040.c static void r6040_mac_address(struct net_device *dev) · line 805

Quoted 7 lines
drivers/net/r6040.c +1 -1
@@ -800,7 +800,7 @@ static void r6040_mac_address(struct net_device *dev)
 	iowrite16(0x01, ioaddr + MCR1); /* Reset MAC */
 	iowrite16(2, ioaddr + MAC_SM); /* Reset internal state machine */
 	iowrite16(0, ioaddr + MAC_SM);
-	udelay(5000);
+	mdelay(5);
 
 	/* Restore MAC Address */

applied