smc911x: make smc911x_initialize return correct value

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>
This commit is contained in:
Mike Rapoport 2009-11-12 15:35:08 +02:00 committed by Ben Warren
parent c44efcf97b
commit fbd47b6753

View 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;
}