Use the existing debug macros
What if you have multiple devices at once one in each state ?
Why is this global ?
Again shouldn't be using globals and needs to support multiple devices.
See the tty_struct - there is a field for an ldisc pointer, stuff
st_gdata in there at open time and pass tty around ?
Explain the locking on this NULL test - what stops it becoming NULL
between the if and the assignment ?
I think this code needs a fair bit of work at this point - locking,
supporting multiple devices at once etc.
Staging perhaps ?
--