summaryrefslogtreecommitdiff
path: root/drivers/staging/dgap
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-07-16 18:28:18 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-16 10:19:55 -0700
commiteda03951c3edc1f95e974096770ee3b02df2a8f5 (patch)
tree79fe790bfdfbd3b6644e6c99be3f43271cfd503d /drivers/staging/dgap
parentac4e504a597903f65e6b365eee3e2675a7d8fe4e (diff)
staging: dgap: rearrange function
Relocate the function dgap_stop() so that in a later patch we can remove the duplicate codes between dgap_stop() and dgap_remove_one(). Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r--drivers/staging/dgap/dgap.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 3a783bff112d..8956228a0e52 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7004,6 +7004,21 @@ static void dgap_cleanup_board(struct board_t *brd)
kfree(brd);
}
+static void dgap_stop(void)
+{
+ unsigned long lock_flags;
+
+ spin_lock_irqsave(&dgap_poll_lock, lock_flags);
+ dgap_poll_stop = 1;
+ spin_unlock_irqrestore(&dgap_poll_lock, lock_flags);
+
+ del_timer_sync(&dgap_poll_timer);
+
+ device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
+ class_destroy(dgap_class);
+ unregister_chrdev(DIGI_DGAP_MAJOR, "dgap");
+}
+
static void dgap_remove_one(struct pci_dev *dev)
{
unsigned int i;
@@ -7096,21 +7111,6 @@ failed_class:
return rc;
}
-static void dgap_stop(void)
-{
- unsigned long lock_flags;
-
- spin_lock_irqsave(&dgap_poll_lock, lock_flags);
- dgap_poll_stop = 1;
- spin_unlock_irqrestore(&dgap_poll_lock, lock_flags);
-
- del_timer_sync(&dgap_poll_timer);
-
- device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
- class_destroy(dgap_class);
- unregister_chrdev(DIGI_DGAP_MAJOR, "dgap");
-}
-
/************************************************************************
*
* Driver load/unload functions