Skip to contentSkip to conversation

smc91xx_eeprom: Correct chip detection check.

PATCH New Juergen Kilb 3 participants 5 messages Jun 12, 2010 – Jul 9, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smc91xx_eeprom: Correct chip detection check.

From: Juergen Kilb <[email protected]>

The smc911x_detect function in /net/driver/net/smc911x.c returns a 0 if everything was ok (a chip was found) and -1 else. In the standalone example 'smc911x_eeprom' the return value of smc911x_detect is interpreted in a different way
(0 for error, !0 as OK).
This leads to the error that the chip will not be detected.

---

 examples/standalone/smc911x_eeprom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
examples/standalone/smc911x_eeprom.c +1 -1
index 104047f..cb3c131 100644
@@ -240,7 +240,7 @@ static void dump_eeprom(struct eth_device *dev)
 static int smc911x_init(struct eth_device *dev)
 {
 	/* See if there is anything there */
-	if (!smc911x_detect_chip(dev))
+	if (smc911x_detect_chip(dev))
 		return 1;
 
 	smc911x_reset(dev);
#1 lore raw

PATCH 1/1 smc91xx_eeprom: Correct chip detection check.

Quoted 6 lines · Juergen Kilb

The smc911x_detect function in /net/driver/net/smc911x.c returns a 0 if everything was ok (a chip was found) and -1 else. In the standalone example 'smc911x_eeprom' the return value of smc911x_detect is interpreted in a different way
(0 for error, !0 as OK).
This leads to the error that the chip will not be detected.

-mike

Applied
#2 lore raw

PATCH 1/1 smc91xx_eeprom: Correct chip detection check.

In reply to Juergen Kilb

Hi Juergen,

Quoted 22 lines · Juergen Kilb

From: Juergen Kilb<[email protected]>

The smc911x_detect function in /net/driver/net/smc911x.c returns a 0 if everything was ok (a chip was found) and -1 else. In the standalone example 'smc911x_eeprom' the return value of smc911x_detect is interpreted in a different way
(0 for error, !0 as OK).
This leads to the error that the chip will not be detected.

---

  examples/standalone/smc911x_eeprom.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
examples/standalone/smc911x_eeprom.c +0 -0
index 104047f..cb3c131 100644

examples/standalone/smc911x_eeprom.c static void dump_eeprom(struct eth_device *dev) · line 246

Quoted 8 lines
examples/standalone/smc911x_eeprom.c +1 -1
@@ -240,7 +240,7 @@ static void dump_eeprom(struct eth_device *dev)
  static int smc911x_init(struct eth_device *dev)
  {
  	/* See if there is anything there */
-	if (!smc911x_detect_chip(dev))
+	if (smc911x_detect_chip(dev))
  		return 1;
 
  	smc911x_reset(dev);

Applied to net/next.

regards,
Ben

#3 lore raw

PATCH 1/1 smc91xx_eeprom: Correct chip detection check.

In reply to Juergen Kilb
Quoted 1 line · On Saturday, June 12, 2010 15:22:01 Juergen Kilb wrote:

should be "off", not "of". you'll have to fix the commit in your net/next tree too Ben ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100709/9dd9a69b/attachment.pgp

#4 lore raw

PATCH 1/1 smc91xx_eeprom: Correct chip detection check.

Quoted 5 lines · Mike Frysinger
Quoted 1 line · On Saturday, June 12, 2010 15:22:01 Juergen Kilb wrote:

should be "off", not "of". you'll have to fix the commit in your net/next tree too Ben ...
-mike

thanks for pointing this out. I'll take care of it this W/E

regards,
Ben