]> git.sur5r.net Git - u-boot/commitdiff
smc911x: make smc911x_initialize return correct value
authorMike Rapoport <mike@compulab.co.il>
Thu, 12 Nov 2009 13:35:08 +0000 (15:35 +0200)
committerBen Warren <biggerbadderben@gmail.com>
Fri, 13 Nov 2009 05:25:57 +0000 (21:25 -0800)
Make smc911x_initialize return -1 on error and number of interfaces
detected otherwise.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
drivers/net/smc911x.c

index c50758e53208ecb75cd4e081ef2dd94293d179cd..c027abe9f7b1661f4556079a9f588ee5c255156a 100644 (file)
@@ -243,7 +243,7 @@ int smc911x_initialize(u8 dev_num, int base_addr)
        dev = malloc(sizeof(*dev));
        if (!dev) {
                free(dev);
-               return 0;
+               return -1;
        }
        memset(dev, 0, sizeof(*dev));
 
@@ -271,5 +271,5 @@ int smc911x_initialize(u8 dev_num, int base_addr)
        sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
        eth_register(dev);
-       return 0;
+       return 1;
 }