linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Curious about tty_port_operations drop() callback.
@ 2013-01-22 16:38 Grant Edwards
  2013-01-23 14:38 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Edwards @ 2013-01-22 16:38 UTC (permalink / raw)
  To: linux-serial

While testing/debugging the tty driver I've changed to use the
tty_port_* helper functions, I noticed there are two
tty_port_operation fields that I'm not providing: destruct() and
drop(). There's an example of destruct() usage in the hvc driver and a
comment in tty.h explaining when it's called, so that's fairly
obvious.

I haven't been able to figure out the purpose of the drop() callback.
It's not used anywhere and there is no comment in tty.h hinting at its
purpose.

Looking at tty_port_close() shows that drop() is called during close()
of port with a reference count > 1.  IOW, close() calls drop() in the
cases where it isn't going to call shutdown().

There doesn't seem to be a corresponding "raise" callback during
open() when activate() isn't going to be called, and I can't think of
any use for either drop or raise...

-- 
Grant Edwards               grant.b.edwards        Yow! My mind is a potato
                                  at               field ...
                              gmail.com            


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

* Re: Curious about tty_port_operations drop() callback.
  2013-01-22 16:38 Curious about tty_port_operations drop() callback Grant Edwards
@ 2013-01-23 14:38 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2013-01-23 14:38 UTC (permalink / raw)
  To: Grant Edwards; +Cc: linux-serial

On Tue, 22 Jan 2013 16:38:54 +0000 (UTC)
Grant Edwards <grant.b.edwards@gmail.com> wrote:

> While testing/debugging the tty driver I've changed to use the
> tty_port_* helper functions, I noticed there are two
> tty_port_operation fields that I'm not providing: destruct() and
> drop(). There's an example of destruct() usage in the hvc driver and a
> comment in tty.h explaining when it's called, so that's fairly
> obvious.
> 
> I haven't been able to figure out the purpose of the drop() callback.
> It's not used anywhere and there is no comment in tty.h hinting at its
> purpose.

It may well no longer be needed. If so then I'm all for its removal.

Alan

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

end of thread, other threads:[~2013-01-23 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22 16:38 Curious about tty_port_operations drop() callback Grant Edwards
2013-01-23 14:38 ` Alan Cox

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).