]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
smc91xx_eeprom: Correct chip detection check.
authorJuergen Kilb <j.jilb@phytec.de>
Sat, 12 Jun 2010 19:22:01 +0000 (21:22 +0200)
committerBen Warren <biggerbadderben@gmail.com>
Mon, 12 Jul 2010 07:14:29 +0000 (00:14 -0700)
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-off-by: Juergen Kilb <j.kilb@phytec.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
examples/standalone/smc911x_eeprom.c

index c51a05028a5e09ed03657fae9696000d55991c16..00e826689f31b5001d3a3846c74088fab29254a4 100644 (file)
@@ -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);