aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tc35815.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-02-24 17:02:16 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-27 04:11:05 -0500
commit420e85241e41fc84b8f5b26c811beb03c472b679 (patch)
treec3c4bf4748abf3759701e3fbec3f1af039926dde /drivers/net/tc35815.c
parentc68644d3304d217d50b8f0a179d4aa7e5a85a5bc (diff)
[netdrvr] tc35815: fix obvious bugs
* clear_page() use is wrong. We might have multiple pages. Use memset() instead. * Call pci_unregister_driver() in module exit. Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/tc35815.c')
-rw-r--r--drivers/net/tc35815.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 81ed82f0b520..eae2b63951f1 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -657,7 +657,7 @@ tc35815_init_queues(struct net_device *dev)
657 dma_cache_wback_inv((unsigned long)lp->fd_buf, PAGE_SIZE * FD_PAGE_NUM); 657 dma_cache_wback_inv((unsigned long)lp->fd_buf, PAGE_SIZE * FD_PAGE_NUM);
658#endif 658#endif
659 } else { 659 } else {
660 clear_page(lp->fd_buf); 660 memset(lp->fd_buf, 0, PAGE_SIZE * FD_PAGE_NUM);
661#ifdef __mips__ 661#ifdef __mips__
662 dma_cache_wback_inv((unsigned long)lp->fd_buf, PAGE_SIZE * FD_PAGE_NUM); 662 dma_cache_wback_inv((unsigned long)lp->fd_buf, PAGE_SIZE * FD_PAGE_NUM);
663#endif 663#endif
@@ -1732,6 +1732,11 @@ static void __exit tc35815_cleanup_module(void)
1732{ 1732{
1733 struct net_device *next_dev; 1733 struct net_device *next_dev;
1734 1734
1735 /*
1736 * TODO: implement a tc35815_driver.remove hook, and
1737 * move this code into that function. Then, delete
1738 * all root_tc35815_dev list handling code.
1739 */
1735 while (root_tc35815_dev) { 1740 while (root_tc35815_dev) {
1736 struct net_device *dev = root_tc35815_dev; 1741 struct net_device *dev = root_tc35815_dev;
1737 next_dev = ((struct tc35815_local *)dev->priv)->next_module; 1742 next_dev = ((struct tc35815_local *)dev->priv)->next_module;
@@ -1740,6 +1745,9 @@ static void __exit tc35815_cleanup_module(void)
1740 free_netdev(dev); 1745 free_netdev(dev);
1741 root_tc35815_dev = next_dev; 1746 root_tc35815_dev = next_dev;
1742 } 1747 }
1748
1749 pci_unregister_driver(&tc35815_driver);
1743} 1750}
1751
1744module_init(tc35815_init_module); 1752module_init(tc35815_init_module);
1745module_exit(tc35815_cleanup_module); 1753module_exit(tc35815_cleanup_module);