staging: dgap: move function before remove
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Thu, 7 May 2015 11:12:20 +0000 (16:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 13:12:09 +0000 (15:12 +0200)
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>
drivers/staging/dgap/dgap.c

index 6766d5a..63d7059 100644 (file)
@@ -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