Skip to contentSkip to conversation

Curious about tty_port_operations drop() callback.

DISCUSSION Grant Edwards 2 participants 2 messages Jan 22, 2013 – Jan 23, 2013 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

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

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! My mind is a potato
                                  at               field ...
                              gmail.com            
#1 lore raw
Quoted 10 lines · On Tue, 22 Jan 2013 16:38:54 +0000 (UTC) Grant Edwards…

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