Skip to contentSkip to conversation

ARM: OMAP3: Refactors the SM911x driver

PATCH New Dirk Behme 2 participants 2 messages Oct 20, 2009 – Oct 22, 2009 Network drivers

lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

PATCH 1/1 ARM: OMAP3: Refactors the SM911x driver

From: Steve Sakoman <[email protected]>

Move the test up in the function to not hang on systems without ethernet.

---
 drivers/net/smc911x.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/smc911x.c +6 -6
Index: u-boot-arm/drivers/net/smc911x.c
===================================================================
@@ -249,6 +249,12 @@ int smc911x_initialize(u8 dev_num, int b
 
 	dev->iobase = base_addr;
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	addrh = smc911x_get_mac_csr(dev, ADDRH);
 	addrl = smc911x_get_mac_csr(dev, ADDRL);
 	dev->enetaddr[0] = addrl;
@@ -264,12 +270,6 @@ int smc911x_initialize(u8 dev_num, int b
 	dev->recv = smc911x_rx;
 	sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
-	/* Try to detect chip. Will fail if not present. */
-	if (smc911x_detect_chip(dev)) {
-		free(dev);
-		return 0;
-	}
-
 	eth_register(dev);
 	return 0;
 }
#1 lore raw

PATCH 1/1 ARM: OMAP3: Refactors the SM911x driver

Quoted 7 lines · Dirk Behme

From: Steve Sakoman <[email protected]>

Move the test up in the function to not hang on systems without ethernet.

Dirk,
Thanks for reposting this.
I will push this to arm.
Ack.
Tom

---

Quoted 37 lines
 drivers/net/smc911x.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Index: u-boot-arm/drivers/net/smc911x.c
===================================================================

drivers/net/smc911x.c +6 -6
@@ -249,6 +249,12 @@ int smc911x_initialize(u8 dev_num, int b
 
 	dev->iobase = base_addr;
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	addrh = smc911x_get_mac_csr(dev, ADDRH);
 	addrl = smc911x_get_mac_csr(dev, ADDRL);
 	dev->enetaddr[0] = addrl;
@@ -264,12 +270,6 @@ int smc911x_initialize(u8 dev_num, int b
 	dev->recv = smc911x_rx;
 	sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
-	/* Try to detect chip. Will fail if not present. */
-	if (smc911x_detect_chip(dev)) {
-		free(dev);
-		return 0;
-	}
-
 	eth_register(dev);
 	return 0;
 }

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot