[TTY] driver sriel tty on ppc board

Sébastien Chrétien sebastien.chretien.enseirb at gmail.com
Thu Aug 28 01:37:41 EST 2008


Hello,

I am trying to code a tty serial driver (UART link). The initialization is :
(model LDD 3)

static int __init tiny_tty_init(void)
{
    int i, retval;

    printk("Initialization of ttyS -> \n");
    tiny_tty_driver=alloc_tty_driver(NB_TTY);
    if(!tiny_tty_driver)
        return -ENOMEM;

    /*Initialize the tty driver*/

    tiny_tty_driver->owner =THIS_MODULE;
    tiny_tty_driver->driver_name = "ttyS";
    tiny_tty_driver->name = "ttyS";
    tiny_tty_driver->major = TTY_MAJOR;
    tiny_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
    tiny_tty_driver->subtype = SERIAL_TYPE_NORMAL;
    tiny_tty_driver->flags = TTY_DRIVER_REAL_RAW;
    tiny_tty_driver->init_termios = tty_std_termios;
    tiny_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD
|HUPCL|CLOCAL;

    tty_set_operations(tiny_tty_driver, &serial_ops);
    /*register the tty driver*/
    retval=tty_register_driver(tiny_tty_driver);
    if(retval)
    {
        printk(KERN_ERR "Failed to register tiny tty driver");
        put_tty_driver(tiny_tty_driver);
        return retval;
    }

    for(i=0; i< NB_TTY; ++i)
        tty_register_device(tiny_tty_driver,i,NULL);
    printk("<-Initialization of ttyS \n");
    return retval;
}

module_init(tiny_tty_init);


but I have a kernel panic :

io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Kernel panic - not syncing: Couldn't register /dev/tty0 driver

Can someone help me to trace the failure ?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080827/36a3d539/attachment.htm>


More information about the Linuxppc-dev mailing list