Hello,<br>
<br>
I am trying to code a tty serial driver (UART link). The initialization is :<br>
(model LDD 3)<br>
<br>
static int __init tiny_tty_init(void)<br>
{<br>
&nbsp;&nbsp;&nbsp; int i, retval;<br>
<br>
&nbsp;&nbsp;&nbsp; printk(&quot;Initialization of ttyS -&gt; \n&quot;);<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver=alloc_tty_driver(NB_TTY);<br>
&nbsp;&nbsp;&nbsp; if(!tiny_tty_driver)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -ENOMEM;<br>
<br>
&nbsp;&nbsp;&nbsp; /*Initialize the tty driver*/<br>
<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;owner =THIS_MODULE;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;driver_name = &quot;ttyS&quot;;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;name = &quot;ttyS&quot;;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;major = TTY_MAJOR;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;type = TTY_DRIVER_TYPE_SERIAL;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;subtype = SERIAL_TYPE_NORMAL;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;flags = TTY_DRIVER_REAL_RAW;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;init_termios = tty_std_termios;<br>
&nbsp;&nbsp;&nbsp; tiny_tty_driver-&gt;init_termios.c_cflag = B9600 | CS8 | CREAD |HUPCL|CLOCAL;<br>
<br>
&nbsp;&nbsp;&nbsp; tty_set_operations(tiny_tty_driver, &amp;serial_ops);<br>
&nbsp;&nbsp;&nbsp; /*register the tty driver*/<br>
&nbsp;&nbsp;&nbsp; retval=tty_register_driver(tiny_tty_driver);<br>
&nbsp;&nbsp;&nbsp; if(retval)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printk(KERN_ERR &quot;Failed to register tiny tty driver&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; put_tty_driver(tiny_tty_driver);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return retval;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; for(i=0; i&lt; NB_TTY; ++i)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tty_register_device(tiny_tty_driver,i,NULL);<br>
&nbsp;&nbsp;&nbsp; printk(&quot;&lt;-Initialization of ttyS \n&quot;);<br>
&nbsp;&nbsp;&nbsp; return retval;<br>
}<br>
<br>
module_init(tiny_tty_init);<br>
<br>
<br>
but I have a kernel panic : <br>
<br>
io scheduler noop registered<br>
io scheduler anticipatory registered<br>
io scheduler deadline registered<br>
io scheduler cfq registered (default)<br>
Kernel panic - not syncing: Couldn&#39;t register /dev/tty0 driver<br>
<br>
Can someone help me to trace the failure ?<br>
<br>
Thanks<br>
<br>