public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] smc91xx_eeprom: Correct chip detection check.
@ 2010-06-12 19:22 Juergen Kilb
  2010-06-13  2:28 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Juergen Kilb @ 2010-06-12 19:22 UTC (permalink / raw)
  To: u-boot

From: Juergen Kilb <j.jilb@phytec.de>

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.

Signed-of-by: Juergen Kilb <j.kilb@phytec.de>
---

 examples/standalone/smc911x_eeprom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/examples/standalone/smc911x_eeprom.c b/examples/standalone/smc911x_eeprom.c
index 104047f..cb3c131 100644
--- a/examples/standalone/smc911x_eeprom.c
+++ b/examples/standalone/smc911x_eeprom.c
@@ -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);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-09 23:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-12 19:22 [U-Boot] [PATCH] smc91xx_eeprom: Correct chip detection check Juergen Kilb
2010-06-13  2:28 ` Mike Frysinger
2010-06-21  6:10 ` Ben Warren
2010-07-09 22:11 ` Mike Frysinger
2010-07-09 23:31   ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox