diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-05-07 16:42:20 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-10 15:12:09 +0200 |
commit | d1c9f3efc47f48bc93106b6bf3fd43f9915da46e (patch) | |
tree | 84eacc5dd8f29b6dac84025d4ec930f3fb21ca76 | |
parent | 76c807210aeaefc164dad49d98927f1a84668d36 (diff) |
staging: dgap: move function before remove
move the cleanup function before the remove call as the next patch of
the series is going to use that.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/dgap/dgap.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 6766d5a91a90..63d70592219c 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -6987,6 +6987,36 @@ cleanup_brd: return rc; } +/* + * dgap_cleanup_board() + * + * Free all the memory associated with a board + */ +static void dgap_cleanup_board(struct board_t *brd) +{ + unsigned int i; + + if (!brd || brd->magic != DGAP_BOARD_MAGIC) + return; + + dgap_free_irq(brd); + + tasklet_kill(&brd->helper_tasklet); + + dgap_unmap(brd); + + /* Free all allocated channels structs */ + for (i = 0; i < MAXPORTS ; i++) + kfree(brd->channels[i]); + + kfree(brd->flipbuf); + kfree(brd->flipflagbuf); + + dgap_board[brd->boardnum] = NULL; + + kfree(brd); +} + static void dgap_remove_one(struct pci_dev *dev) { /* Do Nothing */ @@ -7071,37 +7101,6 @@ static void dgap_stop(void) unregister_chrdev(DIGI_DGAP_MAJOR, "dgap"); } -/* - * dgap_cleanup_board() - * - * Free all the memory associated with a board - */ -static void dgap_cleanup_board(struct board_t *brd) -{ - unsigned int i; - - if (!brd || brd->magic != DGAP_BOARD_MAGIC) - return; - - dgap_free_irq(brd); - - tasklet_kill(&brd->helper_tasklet); - - dgap_unmap(brd); - - /* Free all allocated channels structs */ - for (i = 0; i < MAXPORTS ; i++) - kfree(brd->channels[i]); - - kfree(brd->flipbuf); - kfree(brd->flipflagbuf); - - dgap_board[brd->boardnum] = NULL; - - kfree(brd); -} - - /************************************************************************ * * Driver load/unload functions |