--- zzzz-none-000/linux-2.6.19.2/drivers/char/vt.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/drivers/char/vt.c 2007-06-04 13:25:50.000000000 +0000 @@ -619,7 +619,7 @@ if (!vc) { /* strange ... */ - /* printk("redraw_screen: tty %d not allocated ??\n", new_console+1); */ + /*--- printk("[vt:redraw_screen] tty %d not allocated ??\n", fg_console+1); ---*/ return; } @@ -1972,8 +1972,7 @@ /* could this happen? */ static int error = 0; if (!error) { - error = 1; - printk("con_write: tty %d not allocated\n", currcons+1); + error = 1; } release_console_sem(); return 0; @@ -2469,7 +2468,13 @@ int console_num; if (!tty) return; + +#if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) + console_num = tty->index + 1; /*--- MAPOM: fbconsole hack ---*/ +#else /*--- #if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) ---*/ console_num = tty->index; +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) ---*/ + if (!vc_cons_allocated(console_num)) return; set_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); @@ -2482,11 +2487,18 @@ static void con_start(struct tty_struct *tty) { int console_num; - if (!tty) + if (!tty) { return; + } +#if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) + console_num = tty->index + 1; /*--- MAPOM: fbconsole hack ---*/ +#else /*--- #if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) ---*/ console_num = tty->index; - if (!vc_cons_allocated(console_num)) +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) ---*/ + + if (!vc_cons_allocated(console_num)) { return; + } clr_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); } @@ -2511,7 +2523,11 @@ */ static int con_open(struct tty_struct *tty, struct file *filp) { +#if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) + unsigned int currcons = tty->index + 1; /*--- MAPOM: fbconsole hack ---*/ +#else /*--- #if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) ---*/ unsigned int currcons = tty->index; +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_FRAMEBUFFER_CONSOLE) ---*/ int ret = 0; acquire_console_sem(); @@ -2526,11 +2542,13 @@ tty->winsize.ws_row = vc_cons[currcons].d->vc_rows; tty->winsize.ws_col = vc_cons[currcons].d->vc_cols; } - release_console_sem(); - vcs_make_sysfs(tty); - return ret; + goto con_open_end; + /*--- release_console_sem(); ---*/ + /*--- vcs_make_sysfs(tty); ---*/ + /*--- return ret; ---*/ } } +con_open_end: release_console_sem(); return ret; } @@ -2604,8 +2622,10 @@ acquire_console_sem(); - if (conswitchp) + if (conswitchp) { display_desc = conswitchp->con_startup(); + } + if (!display_desc) { fg_console = 0; release_console_sem(); @@ -2726,8 +2746,9 @@ struct con_driver *con_driver; int i, j = -1, k = -1, retval = -ENODEV; - if (!try_module_get(owner)) + if (!try_module_get(owner)) { return -ENODEV; + } acquire_console_sem(); @@ -2742,8 +2763,9 @@ } } - if (retval) + if (retval) { goto err; + } if (!(con_driver->flag & CON_DRIVER_FLAG_INIT)) { csw->con_startup(); @@ -2928,8 +2950,7 @@ const struct consw *defcsw = NULL, *csw = NULL; int i, more = 1, first = -1, last = -1, deflt = 0; - if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || - con_is_graphics(con->con, con->first, con->last)) + if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || con_is_graphics(con->con, con->first, con->last)) goto err; csw = con->con;