diff options
Diffstat (limited to 'drivers/net/lance.c')
-rw-r--r-- | drivers/net/lance.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index dec557fb6a99..b4929beb33b2 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -356,11 +356,8 @@ int init_module(void) | |||
356 | dev->base_addr = io[this_dev]; | 356 | dev->base_addr = io[this_dev]; |
357 | dev->dma = dma[this_dev]; | 357 | dev->dma = dma[this_dev]; |
358 | if (do_lance_probe(dev) == 0) { | 358 | if (do_lance_probe(dev) == 0) { |
359 | if (register_netdev(dev) == 0) { | 359 | dev_lance[found++] = dev; |
360 | dev_lance[found++] = dev; | 360 | continue; |
361 | continue; | ||
362 | } | ||
363 | cleanup_card(dev); | ||
364 | } | 361 | } |
365 | free_netdev(dev); | 362 | free_netdev(dev); |
366 | break; | 363 | break; |
@@ -448,12 +445,7 @@ struct net_device * __init lance_probe(int unit) | |||
448 | err = do_lance_probe(dev); | 445 | err = do_lance_probe(dev); |
449 | if (err) | 446 | if (err) |
450 | goto out; | 447 | goto out; |
451 | err = register_netdev(dev); | ||
452 | if (err) | ||
453 | goto out1; | ||
454 | return dev; | 448 | return dev; |
455 | out1: | ||
456 | cleanup_card(dev); | ||
457 | out: | 449 | out: |
458 | free_netdev(dev); | 450 | free_netdev(dev); |
459 | return ERR_PTR(err); | 451 | return ERR_PTR(err); |
@@ -724,6 +716,9 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int | |||
724 | dev->tx_timeout = lance_tx_timeout; | 716 | dev->tx_timeout = lance_tx_timeout; |
725 | dev->watchdog_timeo = TX_TIMEOUT; | 717 | dev->watchdog_timeo = TX_TIMEOUT; |
726 | 718 | ||
719 | err = register_netdev(dev); | ||
720 | if (err) | ||
721 | goto out_dma; | ||
727 | return 0; | 722 | return 0; |
728 | out_dma: | 723 | out_dma: |
729 | if (dev->dma != 4) | 724 | if (dev->dma != 4) |
@@ -867,7 +862,7 @@ lance_init_ring(struct net_device *dev, int gfp) | |||
867 | lp->rx_skbuff[i] = skb; | 862 | lp->rx_skbuff[i] = skb; |
868 | if (skb) { | 863 | if (skb) { |
869 | skb->dev = dev; | 864 | skb->dev = dev; |
870 | rx_buff = skb->tail; | 865 | rx_buff = skb->data; |
871 | } else | 866 | } else |
872 | rx_buff = kmalloc(PKT_BUF_SZ, GFP_DMA | gfp); | 867 | rx_buff = kmalloc(PKT_BUF_SZ, GFP_DMA | gfp); |
873 | if (rx_buff == NULL) | 868 | if (rx_buff == NULL) |