Skip to contentSkip to conversation

staging: dgnc: use tty_alloc_driver instead of kcalloc

PATCH New Daeseok Youn 1 participant 1 message Apr 14, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgnc: use tty_alloc_driver instead of kcalloc

The tty_alloc_driver() can allocate memory for ttys and termios. And also allocated memory will be released easily with put_tty_driver() call.

---
 drivers/staging/dgnc/dgnc_driver.h |   4 +-
 drivers/staging/dgnc/dgnc_tty.c    | 144 ++++++++++++++++---------------------
 2 files changed, 62 insertions(+), 86 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +2 -2
index 6609ba5..95ec729 100644
@@ -202,9 +202,9 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver serial_driver;
+	struct tty_driver *serial_driver;
 	char		serial_name[200];
-	struct tty_driver print_driver;
+	struct tty_driver *print_driver;
 	char		print_name[200];
 
 	bool		dgnc_major_serial_registered;
drivers/staging/dgnc/dgnc_tty.c +60 -84

222 lines not on this page · raw message

Signature · 1 line
2.8.1