Skip to contentSkip to conversation

fix miiphy alloc

PATCH In review Jan Weitzel 2 participants 2 messages Apr 14, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix miiphy alloc

if fec was allocated using malloc. if fec->miiphy->dev->driver != 0 miiphy_probe is not called

---

drivers/net/fec_imx.c +4 -4
Index: barebox-2010.04.0/drivers/net/fec_imx.c
===================================================================
@@ -542,10 +542,10 @@
 #ifdef CONFIG_ARCH_IMX27
 	PCCR0 |= PCCR0_FEC_EN;
 #endif
-        edev = (struct eth_device *)xzalloc(sizeof(struct eth_device));
-        dev->type_data = edev;
-	fec = (struct fec_priv *)malloc(sizeof(*fec));
-        edev->priv = fec;
+	edev = (struct eth_device *)xzalloc(sizeof(struct eth_device));
+	dev->type_data = edev;
+	fec = (struct fec_priv *)xzalloc(sizeof(*fec));
+	edev->priv = fec;
 	edev->open = fec_open,
 	edev->init = fec_init,
 	edev->send = fec_send,

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

maintainer
#1 lore raw

Hi Jan,

Quoted 2 lines · Jan Weitzel

if fec was allocated using malloc. if fec->miiphy->dev->driver != 0 miiphy_probe is not called

Thanks, both applied.

Sascha

Quoted 29 lines

---
Index: barebox-2010.04.0/drivers/net/fec_imx.c
===================================================================

drivers/net/fec_imx.c +4 -4
@@ -542,10 +542,10 @@
 #ifdef CONFIG_ARCH_IMX27
 	PCCR0 |= PCCR0_FEC_EN;
 #endif
-        edev = (struct eth_device *)xzalloc(sizeof(struct eth_device));
-        dev->type_data = edev;
-	fec = (struct fec_priv *)malloc(sizeof(*fec));
-        edev->priv = fec;
+	edev = (struct eth_device *)xzalloc(sizeof(struct eth_device));
+	dev->type_data = edev;
+	fec = (struct fec_priv *)xzalloc(sizeof(*fec));
+	edev->priv = fec;
 	edev->open = fec_open,
 	edev->init = fec_init,
 	edev->send = fec_send,

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox