staging: dgap: uses kzalloc for allocating memory
authorLidza Louina <lidza.louina@gmail.com>
Fri, 20 Dec 2013 02:12:12 +0000 (21:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 16:54:46 +0000 (08:54 -0800)
Originally, this driver created it's own allocating
function. This patch removes that function and calls
kzalloc directly.

This patch affects:
 - driver.c
 - driver.h
 - fep5.c
 - tty.c

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap_driver.c
drivers/staging/dgap/dgap_driver.h
drivers/staging/dgap/dgap_fep5.c
drivers/staging/dgap/dgap_tty.c

index 4c1515e..089d017 100644 (file)
@@ -506,7 +506,7 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 
        /* get the board structure and prep it */
        brd = dgap_Board[dgap_NumBoards] =
-       (struct board_t *) dgap_driver_kzmalloc(sizeof(struct board_t), GFP_KERNEL);
+       (struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
        if (!brd) {
                APR(("memory allocation for board structure failed\n"));
                return(-ENOMEM);
@@ -514,7 +514,7 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 
        /* make a temporary message buffer for the boot messages */
        brd->msgbuf = brd->msgbuf_head =
-               (char *) dgap_driver_kzmalloc(sizeof(char) * 8192, GFP_KERNEL);
+               (char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
        if(!brd->msgbuf) {
                kfree(brd);
                APR(("memory allocation for board msgbuf failed\n"));
@@ -924,20 +924,6 @@ static void dgap_init_globals(void)
  ************************************************************************/
 
 
-/*
- * dgap_driver_kzmalloc()
- *
- * Malloc and clear memory,
- */
-void *dgap_driver_kzmalloc(size_t size, int priority)
-{
-       void *p = kmalloc(size, priority);
-       if(p)
-               memset(p, 0, size);
-       return(p);
-}
-
-
 /*
  * dgap_mbuf()
  *
index 7d631e8..2f7a55a 100644 (file)
@@ -578,7 +578,6 @@ struct channel_t {
  *************************************************************************/
 
 extern int             dgap_ms_sleep(ulong ms);
-extern void            *dgap_driver_kzmalloc(size_t size, int priority);
 extern char            *dgap_ioctl_name(int cmd);
 extern void            dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len);
 extern void            dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len);
Simple merge
Simple merge