[U-Boot] [PATCH 11/12] sh_eth: Fix return value of sh_eth_initialize()

Matthias Kaehlcke matthias at kaehlcke.net
Sun Jan 24 11:07:59 CET 2010


sh_eth: Return 1 from sh_eth_initialize() upon successful initialization and
0 in case of failure

Signed-off-by: Matthias Kaehlcke <matthias at kaehlcke.net>
---
 drivers/net/sh_eth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 86cc324..330c17c 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -627,21 +627,21 @@ void sh_eth_halt(struct eth_device *dev)
 
 int sh_eth_initialize(bd_t *bd)
 {
-    int ret = 0;
+    int ret = 1;
 	struct sh_eth_dev *eth = NULL;
     struct eth_device *dev = NULL;
 
     eth = (struct sh_eth_dev *)malloc(sizeof(struct sh_eth_dev));
 	if (!eth) {
 		printf(SHETHER_NAME ": %s: malloc failed\n", __func__);
-		ret = -ENOMEM;
+		ret = 0;
 		goto err;
 	}
 
     dev = (struct eth_device *)malloc(sizeof(struct eth_device));
 	if (!dev) {
 		printf(SHETHER_NAME ": %s: malloc failed\n", __func__);
-		ret = -ENOMEM;
+		ret = 0;
 		goto err;
 	}
     memset(dev, 0, sizeof(struct eth_device));
-- 
1.6.3.1



More information about the U-Boot mailing list