diff options
-rw-r--r-- | drivers/net/fec.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index f8396fb30326..e03b1773966d 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1660,11 +1660,10 @@ int __init fec_enet_init(struct net_device *dev, int index) | |||
1660 | struct bufdesc *bdp, *cbd_base; | 1660 | struct bufdesc *bdp, *cbd_base; |
1661 | int i, j; | 1661 | int i, j; |
1662 | 1662 | ||
1663 | /* Allocate memory for buffer descriptors. | 1663 | /* Allocate memory for buffer descriptors. */ |
1664 | */ | 1664 | cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma, |
1665 | mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, | 1665 | GFP_KERNEL); |
1666 | &fep->bd_dma, GFP_KERNEL); | 1666 | if (!cbd_base) { |
1667 | if (mem_addr == 0) { | ||
1668 | printk("FEC: allocate descriptor memory failed?\n"); | 1667 | printk("FEC: allocate descriptor memory failed?\n"); |
1669 | return -ENOMEM; | 1668 | return -ENOMEM; |
1670 | } | 1669 | } |
@@ -1698,10 +1697,7 @@ int __init fec_enet_init(struct net_device *dev, int index) | |||
1698 | } | 1697 | } |
1699 | #endif | 1698 | #endif |
1700 | 1699 | ||
1701 | cbd_base = (struct bufdesc *)mem_addr; | 1700 | /* Set receive and transmit descriptor base. */ |
1702 | |||
1703 | /* Set receive and transmit descriptor base. | ||
1704 | */ | ||
1705 | fep->rx_bd_base = cbd_base; | 1701 | fep->rx_bd_base = cbd_base; |
1706 | fep->tx_bd_base = cbd_base + RX_RING_SIZE; | 1702 | fep->tx_bd_base = cbd_base + RX_RING_SIZE; |
1707 | 1703 | ||