aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLidza Louina <lidza.louina@gmail.com>2013-08-27 22:13:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-28 00:55:26 -0400
commit52f9d66844ee191e4d4c0c93394749050aa9b9e5 (patch)
tree8299ca8ee52916719296f8f1379f94683360ef3b
parenta7a75386f958daa23ac042c0a12b48944ff41c53 (diff)
staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc
This patch replaces dgnc_driver_kzmalloc with kzalloc. A patch that follows removes the dgnc_driver_kzmalloc function. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/dgnc/dgnc_driver.c6
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c20
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 9fef18ac5358..197c325baa57 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -499,7 +499,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
499 499
500 /* get the board structure and prep it */ 500 /* get the board structure and prep it */
501 brd = dgnc_Board[dgnc_NumBoards] = 501 brd = dgnc_Board[dgnc_NumBoards] =
502 (struct board_t *) dgnc_driver_kzmalloc(sizeof(struct board_t), GFP_KERNEL); 502 (struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
503 if (!brd) { 503 if (!brd) {
504 APR(("memory allocation for board structure failed\n")); 504 APR(("memory allocation for board structure failed\n"));
505 return(-ENOMEM); 505 return(-ENOMEM);
@@ -507,7 +507,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
507 507
508 /* make a temporary message buffer for the boot messages */ 508 /* make a temporary message buffer for the boot messages */
509 brd->msgbuf = brd->msgbuf_head = 509 brd->msgbuf = brd->msgbuf_head =
510 (char *) dgnc_driver_kzmalloc(sizeof(char) * 8192, GFP_KERNEL); 510 (char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
511 if (!brd->msgbuf) { 511 if (!brd->msgbuf) {
512 kfree(brd); 512 kfree(brd);
513 APR(("memory allocation for board msgbuf failed\n")); 513 APR(("memory allocation for board msgbuf failed\n"));
@@ -721,7 +721,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
721 * Okay to malloc with GFP_KERNEL, we are not at interrupt 721 * Okay to malloc with GFP_KERNEL, we are not at interrupt
722 * context, and there are no locks held. 722 * context, and there are no locks held.
723 */ 723 */
724 brd->flipbuf = dgnc_driver_kzmalloc(MYFLIPLEN, GFP_KERNEL); 724 brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
725 725
726 wake_up_interruptible(&brd->state_wait); 726 wake_up_interruptible(&brd->state_wait);
727 727
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index b4fa29f83cd8..a7bb6bceb9e7 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -230,7 +230,7 @@ int dgnc_tty_register(struct board_t *brd)
230 * The kernel wants space to store pointers to 230 * The kernel wants space to store pointers to
231 * tty_struct's and termios's. 231 * tty_struct's and termios's.
232 */ 232 */
233 brd->SerialDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); 233 brd->SerialDriver.ttys = kzalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL);
234 if (!brd->SerialDriver.ttys) 234 if (!brd->SerialDriver.ttys)
235 return(-ENOMEM); 235 return(-ENOMEM);
236 236
@@ -240,12 +240,12 @@ int dgnc_tty_register(struct board_t *brd)
240 kref_init(&brd->SerialDriver.kref); 240 kref_init(&brd->SerialDriver.kref);
241#endif 241#endif
242 242
243 brd->SerialDriver.termios = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); 243 brd->SerialDriver.termios = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL);
244 if (!brd->SerialDriver.termios) 244 if (!brd->SerialDriver.termios)
245 return(-ENOMEM); 245 return(-ENOMEM);
246 246
247#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) 247#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
248 brd->SerialDriver.termios_locked = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); 248 brd->SerialDriver.termios_locked = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL);
249 if (!brd->SerialDriver.termios_locked) 249 if (!brd->SerialDriver.termios_locked)
250 return(-ENOMEM); 250 return(-ENOMEM);
251#endif 251#endif
@@ -289,7 +289,7 @@ int dgnc_tty_register(struct board_t *brd)
289 * tty_struct's and termios's. Must be seperate from 289 * tty_struct's and termios's. Must be seperate from
290 * the Serial Driver so we don't get confused 290 * the Serial Driver so we don't get confused
291 */ 291 */
292 brd->PrintDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); 292 brd->PrintDriver.ttys = kzalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL);
293 if (!brd->PrintDriver.ttys) 293 if (!brd->PrintDriver.ttys)
294 return(-ENOMEM); 294 return(-ENOMEM);
295 295
@@ -299,12 +299,12 @@ int dgnc_tty_register(struct board_t *brd)
299 kref_init(&brd->PrintDriver.kref); 299 kref_init(&brd->PrintDriver.kref);
300#endif 300#endif
301 301
302 brd->PrintDriver.termios = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); 302 brd->PrintDriver.termios = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL);
303 if (!brd->PrintDriver.termios) 303 if (!brd->PrintDriver.termios)
304 return(-ENOMEM); 304 return(-ENOMEM);
305 305
306#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) 306#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
307 brd->PrintDriver.termios_locked = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); 307 brd->PrintDriver.termios_locked = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL);
308 if (!brd->PrintDriver.termios_locked) 308 if (!brd->PrintDriver.termios_locked)
309 return(-ENOMEM); 309 return(-ENOMEM);
310#endif 310#endif
@@ -371,7 +371,7 @@ int dgnc_tty_init(struct board_t *brd)
371 * Okay to malloc with GFP_KERNEL, we are not at 371 * Okay to malloc with GFP_KERNEL, we are not at
372 * interrupt context, and there are no locks held. 372 * interrupt context, and there are no locks held.
373 */ 373 */
374 brd->channels[i] = dgnc_driver_kzmalloc(sizeof(struct channel_t), GFP_KERNEL); 374 brd->channels[i] = kzalloc(sizeof(struct channel_t), GFP_KERNEL);
375 if (!brd->channels[i]) { 375 if (!brd->channels[i]) {
376 DPR_CORE(("%s:%d Unable to allocate memory for channel struct\n", 376 DPR_CORE(("%s:%d Unable to allocate memory for channel struct\n",
377 __FILE__, __LINE__)); 377 __FILE__, __LINE__));
@@ -1392,11 +1392,11 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
1392 DGNC_UNLOCK(ch->ch_lock, lock_flags); 1392 DGNC_UNLOCK(ch->ch_lock, lock_flags);
1393 1393
1394 if (!ch->ch_rqueue) 1394 if (!ch->ch_rqueue)
1395 ch->ch_rqueue = dgnc_driver_kzmalloc(RQUEUESIZE, GFP_KERNEL); 1395 ch->ch_rqueue = kzalloc(RQUEUESIZE, GFP_KERNEL);
1396 if (!ch->ch_equeue) 1396 if (!ch->ch_equeue)
1397 ch->ch_equeue = dgnc_driver_kzmalloc(EQUEUESIZE, GFP_KERNEL); 1397 ch->ch_equeue = kzalloc(EQUEUESIZE, GFP_KERNEL);
1398 if (!ch->ch_wqueue) 1398 if (!ch->ch_wqueue)
1399 ch->ch_wqueue = dgnc_driver_kzmalloc(WQUEUESIZE, GFP_KERNEL); 1399 ch->ch_wqueue = kzalloc(WQUEUESIZE, GFP_KERNEL);
1400 1400
1401 DGNC_LOCK(ch->ch_lock, lock_flags); 1401 DGNC_LOCK(ch->ch_lock, lock_flags);
1402 1402