linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister()
@ 2014-06-13  7:41 Daeseok Youn
  2014-06-13  8:00 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Daeseok Youn @ 2014-06-13  7:41 UTC (permalink / raw)
  To: lidza.louina, gregkh
  Cc: markh, dan.carpenter, driverdev-devel, devel, linux-kernel

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

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgap/dgap.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 497e6f3..4ea7a33 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -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()
  *
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister()
  2014-06-13  7:41 [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister() Daeseok Youn
@ 2014-06-13  8:00 ` Dan Carpenter
  2014-06-13  8:16   ` DaeSeok Youn
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-06-13  8:00 UTC (permalink / raw)
  To: Daeseok Youn
  Cc: lidza.louina, gregkh, markh, driverdev-devel, devel, linux-kernel

On Fri, Jun 13, 2014 at 04:41:47PM +0900, Daeseok Youn wrote:
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister()
  2014-06-13  8:00 ` Dan Carpenter
@ 2014-06-13  8:16   ` DaeSeok Youn
  2014-06-13  8:38     ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: DaeSeok Youn @ 2014-06-13  8:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Lidza Louina, Greg KH, Mark Hounschell, driverdev-devel, devel,
	linux-kernel

Hi, Dan



2014-06-13 17:00 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
> On Fri, Jun 13, 2014 at 04:41:47PM +0900, Daeseok Youn wrote:
>> 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
>
> regards,
> dan carpenter
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister()
  2014-06-13  8:16   ` DaeSeok Youn
@ 2014-06-13  8:38     ` Dan Carpenter
  2014-06-13  8:50       ` DaeSeok Youn
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-06-13  8:38 UTC (permalink / raw)
  To: DaeSeok Youn; +Cc: devel, Lidza Louina, driverdev-devel, linux-kernel, Greg KH

On Fri, Jun 13, 2014 at 05:16:27PM +0900, DaeSeok Youn wrote:
> Hi, Dan
> 
> 
> 
> 2014-06-13 17:00 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
> > On Fri, Jun 13, 2014 at 04:41:47PM +0900, Daeseok Youn wrote:
> >> 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?

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister()
  2014-06-13  8:38     ` Dan Carpenter
@ 2014-06-13  8:50       ` DaeSeok Youn
  0 siblings, 0 replies; 5+ messages in thread
From: DaeSeok Youn @ 2014-06-13  8:50 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, Lidza Louina, driverdev-devel, linux-kernel, Greg KH

2014-06-13 17:38 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
> On Fri, Jun 13, 2014 at 05:16:27PM +0900, DaeSeok Youn wrote:
>> Hi, Dan
>>
>>
>>
>> 2014-06-13 17:00 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
>> > On Fri, Jun 13, 2014 at 04:41:47PM +0900, Daeseok Youn wrote:
>> >> 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?
>
> 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
>
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-13  8:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-13  7:41 [PATCH 5/9] staging: dgap: introduce dgap_tty_unregister() Daeseok Youn
2014-06-13  8:00 ` Dan Carpenter
2014-06-13  8:16   ` DaeSeok Youn
2014-06-13  8:38     ` Dan Carpenter
2014-06-13  8:50       ` DaeSeok Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).