Patchwork sun3: print when lance_open() fails

login
register
mail settings
Submitter roel kluin
Date Feb. 11, 2009, 3:14 p.m.
Message ID <4992EB41.1030405@gmail.com>
Download mbox | patch
Permalink /patch/22924/
State Accepted
Delegated to: David Miller
Headers show

Comments

roel kluin - Feb. 11, 2009, 3:14 p.m.
With while (--i > 0) { ... } i reaches 0; print when lance_open() fails

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 13, 2009, 12:40 a.m.
From: Roel Kluin <roel.kluin@gmail.com>
Date: Wed, 11 Feb 2009 16:14:09 +0100

> With while (--i > 0) { ... } i reaches 0; print when lance_open() fails
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index 4bb8f72..e5beb29 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -428,7 +428,7 @@  static int lance_open( struct net_device *dev )
 	while (--i > 0)
 		if (DREG & CSR0_IDON)
 			break;
-	if (i < 0 || (DREG & CSR0_ERR)) {
+	if (i <= 0 || (DREG & CSR0_ERR)) {
 		DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n",
 					  dev->name, i, DREG ));
 		DREG = CSR0_STOP;