aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 669de028d44f..df49af382159 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -549,12 +549,8 @@ static int gfar_parse_group(struct device_node *np,
549 struct gfar_private *priv, const char *model) 549 struct gfar_private *priv, const char *model)
550{ 550{
551 u32 *queue_mask; 551 u32 *queue_mask;
552 u64 addr, size;
553
554 addr = of_translate_address(np,
555 of_get_address(np, 0, &size, NULL));
556 priv->gfargrp[priv->num_grps].regs = ioremap(addr, size);
557 552
553 priv->gfargrp[priv->num_grps].regs = of_iomap(np, 0);
558 if (!priv->gfargrp[priv->num_grps].regs) 554 if (!priv->gfargrp[priv->num_grps].regs)
559 return -ENOMEM; 555 return -ENOMEM;
560 556
@@ -676,7 +672,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
676 priv->rx_queue[i] = NULL; 672 priv->rx_queue[i] = NULL;
677 673
678 for (i = 0; i < priv->num_tx_queues; i++) { 674 for (i = 0; i < priv->num_tx_queues; i++) {
679 priv->tx_queue[i] = (struct gfar_priv_tx_q *)kmalloc( 675 priv->tx_queue[i] = (struct gfar_priv_tx_q *)kzalloc(
680 sizeof (struct gfar_priv_tx_q), GFP_KERNEL); 676 sizeof (struct gfar_priv_tx_q), GFP_KERNEL);
681 if (!priv->tx_queue[i]) { 677 if (!priv->tx_queue[i]) {
682 err = -ENOMEM; 678 err = -ENOMEM;
@@ -689,7 +685,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
689 } 685 }
690 686
691 for (i = 0; i < priv->num_rx_queues; i++) { 687 for (i = 0; i < priv->num_rx_queues; i++) {
692 priv->rx_queue[i] = (struct gfar_priv_rx_q *)kmalloc( 688 priv->rx_queue[i] = (struct gfar_priv_rx_q *)kzalloc(
693 sizeof (struct gfar_priv_rx_q), GFP_KERNEL); 689 sizeof (struct gfar_priv_rx_q), GFP_KERNEL);
694 if (!priv->rx_queue[i]) { 690 if (!priv->rx_queue[i]) {
695 err = -ENOMEM; 691 err = -ENOMEM;
@@ -1120,10 +1116,10 @@ static int gfar_probe(struct of_device *ofdev,
1120 /* provided which set of benchmarks. */ 1116 /* provided which set of benchmarks. */
1121 printk(KERN_INFO "%s: Running with NAPI enabled\n", dev->name); 1117 printk(KERN_INFO "%s: Running with NAPI enabled\n", dev->name);
1122 for (i = 0; i < priv->num_rx_queues; i++) 1118 for (i = 0; i < priv->num_rx_queues; i++)
1123 printk(KERN_INFO "%s: :RX BD ring size for Q[%d]: %d\n", 1119 printk(KERN_INFO "%s: RX BD ring size for Q[%d]: %d\n",
1124 dev->name, i, priv->rx_queue[i]->rx_ring_size); 1120 dev->name, i, priv->rx_queue[i]->rx_ring_size);
1125 for(i = 0; i < priv->num_tx_queues; i++) 1121 for(i = 0; i < priv->num_tx_queues; i++)
1126 printk(KERN_INFO "%s:TX BD ring size for Q[%d]: %d\n", 1122 printk(KERN_INFO "%s: TX BD ring size for Q[%d]: %d\n",
1127 dev->name, i, priv->tx_queue[i]->tx_ring_size); 1123 dev->name, i, priv->tx_queue[i]->tx_ring_size);
1128 1124
1129 return 0; 1125 return 0;
@@ -1638,13 +1634,13 @@ static void free_skb_resources(struct gfar_private *priv)
1638 /* Go through all the buffer descriptors and free their data buffers */ 1634 /* Go through all the buffer descriptors and free their data buffers */
1639 for (i = 0; i < priv->num_tx_queues; i++) { 1635 for (i = 0; i < priv->num_tx_queues; i++) {
1640 tx_queue = priv->tx_queue[i]; 1636 tx_queue = priv->tx_queue[i];
1641 if(!tx_queue->tx_skbuff) 1637 if(tx_queue->tx_skbuff)
1642 free_skb_tx_queue(tx_queue); 1638 free_skb_tx_queue(tx_queue);
1643 } 1639 }
1644 1640
1645 for (i = 0; i < priv->num_rx_queues; i++) { 1641 for (i = 0; i < priv->num_rx_queues; i++) {
1646 rx_queue = priv->rx_queue[i]; 1642 rx_queue = priv->rx_queue[i];
1647 if(!rx_queue->rx_skbuff) 1643 if(rx_queue->rx_skbuff)
1648 free_skb_rx_queue(rx_queue); 1644 free_skb_rx_queue(rx_queue);
1649 } 1645 }
1650 1646