Skip to contentSkip to conversation

staging: dgap: introduce dgap_tty_unregister()

PATCH Superseded Daeseok Youn 2 participants 5 messages Jun 13, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 5/9 staging: dgap: introduce dgap_tty_unregister()

dgap_tty_unregister() will unregister serial_driver and print_driver, and also free related variables.

---
 drivers/staging/dgap/dgap.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/staging/dgap/dgap.c +9 -0
index 497e6f3..4ea7a33 100644
@@ -122,6 +122,7 @@ static int dgap_tty_put_char(struct tty_struct *tty, unsigned char c);
 static void dgap_tty_send_xchar(struct tty_struct *tty, char ch);
 
 static int dgap_tty_register(struct board_t *brd);
+static void dgap_tty_unregister(struct board_t *brd);
 static int dgap_tty_init(struct board_t *);
 static void dgap_tty_free(struct board_t *);
 static void dgap_cleanup_tty(struct board_t *);
@@ -1320,6 +1321,14 @@ free_serial_drv:
 	return rc;
 }
 
+static void dgap_tty_unregister(struct board_t *brd)
+{
+	tty_unregister_driver(brd->print_driver);
+	tty_unregister_driver(brd->serial_driver);
+	put_tty_driver(brd->print_driver);
+	put_tty_driver(brd->serial_driver);
+}
+
 /*
  * dgap_tty_init()
  *
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · Daeseok Youn

dgap_tty_unregister() will unregister serial_driver and print_driver, and also free related variables.

Introducing a static function without a caller will cause a GCC warning about unused functions.

Fold 5,7 and 8 together into one patch. This is still "one thing per patch" because they can't be done separately.

regards,
dan carpenter

#2 lore raw

Hi, Dan

2014-06-13 17:00 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 10 lines · Daeseok Youn
Quoted 3 lines

dgap_tty_unregister() will unregister serial_driver and print_driver, and also free related variables.

Introducing a static function without a caller will cause a GCC warning about unused functions.

Fold 5,7 and 8 together into one patch. This is still "one thing per patch" because they can't be done separately.

OK. I will do. And then this series of patches will resend, right?

Thanks.

regards,
Daeseok Youn

Quoted 4 lines

regards,
dan carpenter

#3 lore raw
Quoted 10 lines · DaeSeok Youn

Hi, Dan

2014-06-13 17:00 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 5 lines · Daeseok Youn
Quoted 3 lines

dgap_tty_unregister() will unregister serial_driver and print_driver, and also free related variables.

Quoted 6 lines
Quoted 5 lines

Introducing a static function without a caller will cause a GCC warning about unused functions.

Fold 5,7 and 8 together into one patch. This is still "one thing per patch" because they can't be done separately.

OK. I will do. And then this series of patches will resend, right?

I'm afraid so. New GCC warnings are against the rules even if you fix it in a later patch.

Since you're redoing it, can I suggest that patch 8 should just move the code to dgap_init_one() and change the dgap_firmware_load() prototype and then another patch should add the error handling.

regards,
dan carpenter

#4 lore raw

2014-06-13 17:38 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 16 lines · DaeSeok Youn
Quoted 15 lines

Hi, Dan

2014-06-13 17:00 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 10 lines · Daeseok Youn
Quoted 3 lines

dgap_tty_unregister() will unregister serial_driver and print_driver, and also free related variables.

Introducing a static function without a caller will cause a GCC warning about unused functions.

Fold 5,7 and 8 together into one patch. This is still "one thing per patch" because they can't be done separately.

Quoted 8 lines
Quoted 1 line

OK. I will do. And then this series of patches will resend, right?

I'm afraid so. New GCC warnings are against the rules even if you fix it in a later patch.

Since you're redoing it, can I suggest that patch 8 should just move the code to dgap_init_one() and change the dgap_firmware_load() prototype and then another patch should add the error handling.

Ok. I will do as your comment.

Thanks.

regards,
Daeseok Youn

Quoted 3 lines

regards,
dan carpenter