diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-02-24 17:02:16 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-27 04:11:05 -0500 |
commit | 420e85241e41fc84b8f5b26c811beb03c472b679 (patch) | |
tree | c3c4bf4748abf3759701e3fbec3f1af039926dde /drivers | |
parent | c68644d3304d217d50b8f0a179d4aa7e5a85a5bc (diff) | |
download | linux-3.10-420e85241e41fc84b8f5b26c811beb03c472b679.tar.gz linux-3.10-420e85241e41fc84b8f5b26c811beb03c472b679.tar.bz2 linux-3.10-420e85241e41fc84b8f5b26c811beb03c472b679.zip |
[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')
-rw-r--r-- | drivers/net/tc35815.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c index 81ed82f0b52..eae2b63951f 100644 --- a/drivers/net/tc35815.c +++ b/drivers/net/tc35815.c @@ -657,7 +657,7 @@ tc35815_init_queues(struct net_device *dev) dma_cache_wback_inv((unsigned long)lp->fd_buf, PAGE_SIZE * FD_PAGE_NUM); #endif } else { - clear_page(lp->fd_buf); + memset(lp->fd_buf, 0, PAGE_SIZE * FD_PAGE_NUM); #ifdef __mips__ dma_cache_wback_inv((unsigned long)lp->fd_buf, PAGE_SIZE * FD_PAGE_NUM); #endif @@ -1732,6 +1732,11 @@ static void __exit tc35815_cleanup_module(void) { struct net_device *next_dev; + /* + * TODO: implement a tc35815_driver.remove hook, and + * move this code into that function. Then, delete + * all root_tc35815_dev list handling code. + */ while (root_tc35815_dev) { struct net_device *dev = root_tc35815_dev; next_dev = ((struct tc35815_local *)dev->priv)->next_module; @@ -1740,6 +1745,9 @@ static void __exit tc35815_cleanup_module(void) free_netdev(dev); root_tc35815_dev = next_dev; } + + pci_unregister_driver(&tc35815_driver); } + module_init(tc35815_init_module); module_exit(tc35815_cleanup_module); |