Skip to contentSkip to conversation

4xx_enet: Fix return value of ppc_4xx_eth_initialize()

PATCH New Matthias Kaehlcke 2 participants 17 messages Jan 24, 2010 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/12 4xx_enet: Fix return value of ppc_4xx_eth_initialize()

4xx_enet: Return 1 from ppc_4xx_eth_initialize() upon successful initialization

---
 drivers/net/4xx_enet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/4xx_enet.c +1 -1
index 2fac641..d61873d 100644
@@ -2077,5 +2077,5 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 #endif
 	}			/* end for each supported device */
 
-	return 0;
+	return 1;
 }
Signature · 1 line
1.6.3.1
#2 lore raw

PATCH 2/12 bfin_EMAC: Fix return value of bfin_EMAC_initialize()

In reply to a message not in the archive

bfin_EMAC: Return 1 from bfin_EMAC_initialize() upon successful initialization

---
 drivers/net/bfin_mac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/bfin_mac.c +1 -1
index ec45b63..f527c9c 100644
@@ -113,7 +113,7 @@ int bfin_EMAC_initialize(bd_t *bis)
 	miiphy_register(dev->name, bfin_miiphy_read, bfin_miiphy_write);
 #endif
 
-	return 0;
+	return 1;
 }
 
 static int bfin_EMAC_send(struct eth_device *dev, volatile void *packet,
Signature · 1 line
1.6.3.1
#3 lore raw

PATCH 3/12 dnet: Fix return value of dnet_eth_initialize()

In reply to a message not in the archive

dnet: Return 1 from dnet_eth_initialize() upon successful initialization

---
 drivers/net/dnet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/dnet.c +1 -1
index bfe87fa..6e7afc3 100644
@@ -391,5 +391,5 @@ int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr)
 
 	eth_register(netdev);
 
-	return 0;
+	return 1;
 }
Signature · 1 line
1.6.3.1
#4 lore raw

PATCH 4/12 fec_mxc: Fix return values of fec_probe()

In reply to a message not in the archive

fec_mxc: Return 1 from fec_probe() upon successfully initialization and 0 in case of failure

---
 drivers/net/fec_mxc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/fec_mxc.c +2 -2
index 19116f2..dc8a020 100644
@@ -667,7 +667,7 @@ static int fec_probe(bd_t *bd)
 	edev = (struct eth_device *)malloc(sizeof(struct eth_device));
 	if (!edev) {
 		puts("fec_imx27: not enough malloc memory!\n");
-		return -ENOMEM;
+		return 0;
 	}
 	edev->priv = fec;
 	edev->init = fec_init;
@@ -732,7 +732,7 @@ static int fec_probe(bd_t *bd)
 	memcpy(edev->enetaddr, ethaddr, 6);
 	fec_set_hwaddr(edev, ethaddr);
 
-	return 0;
+	return 1;
 }
 
 int fecmxc_initialize(bd_t *bd)
Signature · 1 line
1.6.3.1
#5 lore raw

PATCH 4/12 fec_mxc: Fix return values of fec_probe()

drivers/net/fec_mxc.c static int fec_probe(bd_t *bd) · line 671

Quoted 9 lines · On Sunday 24 January 2010 05:07:29 Matthias Kaehlcke wrote:
drivers/net/fec_mxc.c +1 -1
@@ -667,7 +667,7 @@ static int fec_probe(bd_t *bd)
 	edev = (struct eth_device *)malloc(sizeof(struct eth_device));
 	if (!edev) {
 		puts("fec_imx27: not enough malloc memory!\n");
-		return -ENOMEM;
+		return 0;
 	}

error path should return -1, not 0
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100124/3bf31079/attachment.pgp

#6 lore raw

PATCH 5/12 fsl_mcdmafec: Fix return value of mcdmafec_initialize()

In reply to a message not in the archive

fsl_mcdmafec: Return 1 from mcdmafec_initialize() upon successful initialization

---
 drivers/net/fsl_mcdmafec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/fsl_mcdmafec.c +1 -1
index 35a6dfb..c26b297 100644
@@ -584,5 +584,5 @@ int mcdmafec_initialize(bd_t * bis)
 	/* default speed */
 	bis->bi_ethspeed = 10;
 
-	return 0;
+	return 1;
 }
Signature · 1 line
1.6.3.1
#7 lore raw

PATCH 6/12 INCA IP: Fix return value of inca_switch_initialize()

In reply to a message not in the archive

INCA IP: Return 1 from inca_switch_initialize() upon successful initialization

---
 drivers/net/inca-ip_sw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/inca-ip_sw.c +1 -1
index 492f5ce..d579e4f 100644
@@ -200,7 +200,7 @@ int inca_switch_initialize(bd_t * bis)
 	printf("Leaving inca_switch_initialize()\n");
 #endif
 
-	return 0;
+	return 1;
 }
 
 
Signature · 1 line
1.6.3.1
#8 lore raw

PATCH 7/12 lan91c96: Fix return value of lan91c96_initialize()

In reply to a message not in the archive

lan91c96: Return 1 from lan91c96_initialize() upon successful initialization

---
 drivers/net/lan91c96.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/lan91c96.c +1 -1
index 90e4002..d255179 100644
@@ -817,5 +817,5 @@ int lan91c96_initialize(u8 dev_num, int base_addr)
 	sprintf(dev->name, "%s-%hu", supported_chips[r].name, dev_num);
 
 	eth_register(dev);
-	return 0;
+	return 1;
 }
Signature · 1 line
1.6.3.1
#9 lore raw

PATCH 8/12 macb: Fix return values of macb_eth_initialize()

In reply to a message not in the archive

macb: Return 1 from macb_eth_initialize() upon successful initialization and 0 in case of failure

---
 drivers/net/macb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/macb.c +2 -2
index c184353..e2a0724 100644
@@ -500,7 +500,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
 	macb = malloc(sizeof(struct macb_device));
 	if (!macb) {
 		printf("Error: Failed to allocate memory for MACB%d\n", id);
-		return -1;
+		return 0;
 	}
 	memset(macb, 0, sizeof(struct macb_device));
 
@@ -542,7 +542,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
 
 	eth_register(netdev);
 
-	return 0;
+	return 1;
 }
 
 #endif
Signature · 1 line
1.6.3.1
#10 lore raw

PATCH 8/12 macb: Fix return values of macb_eth_initialize()

drivers/net/macb.c int macb_eth_initialize(int id, void *regs, unsigned · line 504

Quoted 9 lines · On Sunday 24 January 2010 05:07:46 Matthias Kaehlcke wrote:
drivers/net/macb.c +1 -1
@@ -500,7 +500,7 @@ int macb_eth_initialize(int id, void *regs, unsigned
 int phy_addr) macb = malloc(sizeof(struct macb_device));
 	if (!macb) {
 		printf("Error: Failed to allocate memory for MACB%d\n", id);
-		return -1;
+		return 0;
 	}

this is an error path thus the current code is correct
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100124/9cd210ad/attachment.pgp

#11 lore raw

PATCH 9/12 mcffec: Fix return value of mcffec_initialize()

In reply to a message not in the archive

mcffec: Return the number of initialized devices from mcffec_initialize()

---
 drivers/net/mcffec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mcffec.c +1 -1
index 64be5de..6043ca1 100644
@@ -622,5 +622,5 @@ int mcffec_initialize(bd_t * bis)
 	/* default speed */
 	bis->bi_ethspeed = 10;
 
-	return 0;
+	return i;
 }
Signature · 1 line
1.6.3.1
#12 lore raw

PATCH 10/12 plb2800: Fix return values of plb2800_eth_initialize()

In reply to a message not in the archive

plb2800: Return 1 from plb2800_eth_initialize() upon successful initialization and 0 in case of failure

---
 drivers/net/plb2800_eth.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/plb2800_eth.c +2 -2
index d799c73..ccbced2 100644
@@ -106,7 +106,7 @@ int plb2800_eth_initialize(bd_t * bis)
 	if (!(dev = (struct eth_device *) malloc (sizeof *dev)))
 	{
 		printf("Failed to allocate memory\n");
-		return -1;
+		return 0;
 	}
 	memset(dev, 0, sizeof(*dev));
 
@@ -141,7 +141,7 @@ int plb2800_eth_initialize(bd_t * bis)
 	printf("Leaving plb2800_eth_initialize()\n");
 #endif
 
-	return 0;
+	return 1;
 }
 
 static int plb2800_eth_init(struct eth_device *dev, bd_t * bis)
Signature · 1 line
1.6.3.1
#13 lore raw

PATCH 10/12 plb2800: Fix return values of plb2800_eth_initialize ()

drivers/net/plb2800_eth.c int plb2800_eth_initialize(bd_t * bis) · line 110

Quoted 9 lines · On Sunday 24 January 2010 05:07:55 Matthias Kaehlcke wrote:
drivers/net/plb2800_eth.c +1 -1
@@ -106,7 +106,7 @@ int plb2800_eth_initialize(bd_t * bis)
 	if (!(dev = (struct eth_device *) malloc (sizeof *dev)))
 	{
 		printf("Failed to allocate memory\n");
-		return -1;
+		return 0;
 	}

this is an error path, thus current value is correct
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100124/4fba7812/attachment.pgp

#14 lore raw

PATCH 11/12 sh_eth: Fix return value of sh_eth_initialize()

In reply to a message not in the archive

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

---
 drivers/net/sh_eth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/sh_eth.c +3 -3
index 86cc324..330c17c 100644
@@ -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));
Signature · 1 line
1.6.3.1
#15 lore raw

PATCH 11/12 sh_eth: Fix return value of sh_eth_initialize()

Quoted 7 lines · On Sunday 24 January 2010 05:07:59 Matthias Kaehlcke wrote:
drivers/net/sh_eth.c +1 -1
     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;

drivers/net/sh_eth.c void sh_eth_halt(struct eth_device *dev) · line 646

Quoted 10 lines
drivers/net/sh_eth.c +1 -1
 		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;
 	}

these are error paths and thus should be -1
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100124/23f3a6c3/attachment.pgp

#16 lore raw

PATCH 11/12 sh_eth: Fix return value of sh_eth_initialize()

Hi Mike,

El Sun, Jan 24, 2010 at 05:57:52AM -0500 Mike Frysinger ha dit:

Quoted 11 lines · On Sunday 24 January 2010 05:07:59 Matthias Kaehlcke wrote:
Quoted 10 lines
drivers/net/sh_eth.c +1 -1
     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;
 	}
Quoted 9 lines

drivers/net/sh_eth.c void sh_eth_halt(struct eth_device *dev) · line 646

Quoted 7 lines
     dev = (struct eth_device *)malloc(sizeof(struct eth_device));
drivers/net/sh_eth.c +1 -1
 	if (!dev) {
 		printf(SHETHER_NAME ": %s: malloc failed\n", __func__);
-		ret = -ENOMEM;
+		ret = 0;
 		goto err;
 	}

these are error paths and thus should be -1

you are right if Ben makes the change in net/eth.c he proposed

Signature · 12 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

        Representation of the world, like the world itself, is
        the work of men; they describe it from their own point
         of view, which they  confuse with the absolute truth
                          (Simone de Beauvoir)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
#17 lore raw

PATCH 12/12 smc91111: Fix return value of smc91111_initialize()

In reply to a message not in the archive

smc91111: Return 1 from smc91111_initialize() upon successful initialization

---
 drivers/net/smc91111.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/smc91111.c +1 -1
index 54a1bfb..528efb1 100644
@@ -1377,5 +1377,5 @@ int smc91111_initialize(u8 dev_num, int base_addr)
 	sprintf(dev->name, "%s-%hu", SMC_DEV_NAME, dev_num);
 
 	eth_register(dev);
-	return 0;
+	return 1;
 }
Signature · 1 line
1.6.3.1