Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219999
b: refs/heads/master
c: c95aef4
h: refs/heads/master
i:
  219997: 4cf2cf2
  219995: 99c5a20
  219991: dc044bc
  219983: 97f6c50
  219967: ef151bb
v: v3
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 30, 2010
1 parent fc01691 commit 79be604
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52cab756a2da989859322aed0573a851aa88731c
refs/heads/master: c95aef4161c38775d58cca522e4c4b69eb97548e
32 changes: 20 additions & 12 deletions trunk/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,7 @@ int ft1000_copy_up_pkt(struct net_device *dev)
tempword);
ft1000_flush_fifo(dev, DSP_PKTPHCKSUM_INFO);
info->stats.rx_errors++;
kfree_skb(skb);
return FAILURE;
}
//subtract the number of bytes read already
Expand All @@ -1711,6 +1712,7 @@ int ft1000_copy_up_pkt(struct net_device *dev)
*pbuffer++ = (u8) (tempword >> 8);
*pbuffer++ = (u8) tempword;
if (ft1000_chkcard(dev) == FALSE) {
kfree_skb(skb);
return FAILURE;
}
}
Expand Down Expand Up @@ -2236,35 +2238,31 @@ struct net_device *init_ft1000_card(unsigned short irq, int port,

if (request_irq(dev->irq, ft1000_interrupt, IRQF_SHARED, dev->name, dev)) {
printk(KERN_ERR "ft1000: Could not request_irq\n");
kfree(dev);
return (NULL);
goto err_dev;
}

request_region(dev->base_addr, 256, dev->name);
if (request_region(dev->base_addr, 256, dev->name) == NULL) {
printk(KERN_ERR "ft1000: Could not request_region\n");
goto err_irq;
}

if (register_netdev(dev) != 0) {
DEBUG(0, "ft1000: Could not register netdev");
return NULL;
goto err_reg;
}

info->AsicID = ft1000_read_reg(dev, FT1000_REG_ASIC_ID);
if (info->AsicID == ELECTRABUZZ_ID) {
DEBUG(0, "ft1000_hw: ELECTRABUZZ ASIC\n");
if (request_firmware(&fw_entry, "ft1000.img", fdev) != 0) {
printk(KERN_INFO "ft1000: Could not open ft1000.img\n");
unregister_netdev(dev);
free_irq(dev->irq, dev);
kfree(dev);
return NULL;
goto err_unreg;
}
} else {
DEBUG(0, "ft1000_hw: MAGNEMITE ASIC\n");
if (request_firmware(&fw_entry, "ft2000.img", fdev) != 0) {
printk(KERN_INFO "ft1000: Could not open ft2000.img\n");
unregister_netdev(dev);
free_irq(dev->irq, dev);
kfree(dev);
return NULL;
goto err_unreg;
}
}

Expand All @@ -2279,6 +2277,16 @@ struct net_device *init_ft1000_card(unsigned short irq, int port,
dev->dev_addr[1], dev->dev_addr[2], dev->dev_addr[3],
dev->dev_addr[4], dev->dev_addr[5]);
return dev;

err_unreg:
unregister_netdev(dev);
err_reg:
release_region(dev->base_addr, 256);
err_irq:
free_irq(dev->irq, dev);
err_dev:
free_netdev(dev);
return NULL;
}

EXPORT_SYMBOL(init_ft1000_card);
Expand Down

0 comments on commit 79be604

Please sign in to comment.