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>
int i, retval;<br>
<br>
printk("Initialization of ttyS -> \n");<br>
tiny_tty_driver=alloc_tty_driver(NB_TTY);<br>
if(!tiny_tty_driver)<br>
return -ENOMEM;<br>
<br>
/*Initialize the tty driver*/<br>
<br>
tiny_tty_driver->owner =THIS_MODULE;<br>
tiny_tty_driver->driver_name = "ttyS";<br>
tiny_tty_driver->name = "ttyS";<br>
tiny_tty_driver->major = TTY_MAJOR;<br>
tiny_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;<br>
tiny_tty_driver->subtype = SERIAL_TYPE_NORMAL;<br>
tiny_tty_driver->flags = TTY_DRIVER_REAL_RAW;<br>
tiny_tty_driver->init_termios = tty_std_termios;<br>
tiny_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD |HUPCL|CLOCAL;<br>
<br>
tty_set_operations(tiny_tty_driver, &serial_ops);<br>
/*register the tty driver*/<br>
retval=tty_register_driver(tiny_tty_driver);<br>
if(retval)<br>
{<br>
printk(KERN_ERR "Failed to register tiny tty driver");<br>
put_tty_driver(tiny_tty_driver);<br>
return retval;<br>
}<br>
<br>
for(i=0; i< NB_TTY; ++i)<br>
tty_register_device(tiny_tty_driver,i,NULL);<br>
printk("<-Initialization of ttyS \n");<br>
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't register /dev/tty0 driver<br>
<br>
Can someone help me to trace the failure ?<br>
<br>
Thanks<br>
<br>