Yeah, I'd say it is pretty horrible too, but this the only API that
exists presently and it is not at all obvious how to use it.
I am fine with keeping it out of the tree, IE this patch is dropped
from merge consideration for now. It is obvious that it is a moving
target because the patch to 2.6.27 looked different than 2.6.28. Even
with it out of the tree I am interested in fixing the "error paths"
you mentioned. Perhaps in this case the return of tty_init_dev()
needed further checking and that was what you were stating is incorrect?
If there is another API, please point me to it. I am not aware of how
to get uart startup code to run without going through the
tty->ops->open(). The kgdboc module has only a generic high level
interface and makes use of only the high level tty calls. The
debugger's needs are the same as the console and the user space. The
early debug is still a special case, but in the ideal world there
would be a way to hand off from early debug into the struct tty_port
at the point that console_init() is called.
Let me know when we get closer to that stage, as I am interested in
figuring out how to have a uniform way to share the hardware between
the polled and interrupt drive contexts.
Thanks,
Jason.
--