[U-Boot] [PATCH 1/5] smc911x: return -1 when initialization fails
Mike Rapoport
mike at compulab.co.il
Wed Nov 11 09:03:00 CET 2009
Signed-off-by: Mike Rapoport <mike at compulab.co.il>
---
drivers/net/smc911x.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index acc2306..57ad806 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -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));
@@ -252,7 +252,7 @@ int smc911x_initialize(u8 dev_num, int base_addr)
/* Try to detect chip. Will fail if not present. */
if (smc911x_detect_chip(dev)) {
free(dev);
- return 0;
+ return -1;
}
addrh = smc911x_get_mac_csr(dev, ADDRH);
--
1.6.0.6
More information about the U-Boot
mailing list