[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1430997141-12446-1-git-send-email-sudipm.mukherjee@gmail.com>
Date: Thu, 7 May 2015 16:42:20 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Lidza Louina <lidza.louina@...il.com>,
Mark Hounschell <markh@...pro.net>,
Daeseok Youn <daeseok.youn@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: driverdev-devel@...uxdriverproject.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH 1/2] 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@...torindia.org>
---
drivers/staging/dgap/dgap.c | 61 ++++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 6766d5a..63d7059 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
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists