X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=drivers%2Fs390%2Fchar%2Fcon3215.c;h=606f6ad285a0e3db07ea97f919d467c35818d6c1;hb=600b5d163d7434332539cac7be00f649cbbfedcc;hp=f11a67fda40e55a4a009ff04f16a6217b8fa76c1;hpb=5696c1944a33b4434a9a1ebb6383b906afd43a10;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index f11a67fda40e..606f6ad285a0 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -16,10 +16,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -432,8 +434,6 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) if (count > slen) count = slen; } else - if (count >= TTY_FLIPBUF_SIZE - tty->flip.count) - count = TTY_FLIPBUF_SIZE - tty->flip.count - 1; EBCASC(raw->inbuf, count); cchar = ctrlchar_handle(raw->inbuf, count, tty); switch (cchar & CTRLCHAR_MASK) { @@ -441,28 +441,20 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) break; case CTRLCHAR_CTRL: - tty->flip.count++; - *tty->flip.flag_buf_ptr++ = TTY_NORMAL; - *tty->flip.char_buf_ptr++ = cchar; + tty_insert_flip_char(tty, cchar, TTY_NORMAL); tty_flip_buffer_push(raw->tty); break; case CTRLCHAR_NONE: - memcpy(tty->flip.char_buf_ptr, - raw->inbuf, count); if (count < 2 || - (strncmp(raw->inbuf+count-2, "^n", 2) && - strncmp(raw->inbuf+count-2, "\252n", 2)) ) { - /* don't add the auto \n */ - tty->flip.char_buf_ptr[count] = '\n'; - memset(tty->flip.flag_buf_ptr, - TTY_NORMAL, count + 1); + (strncmp(raw->inbuf+count-2, "\252n", 2) && + strncmp(raw->inbuf+count-2, "^n", 2)) ) { + /* add the auto \n */ + raw->inbuf[count] = '\n'; count++; } else - count-=2; - tty->flip.char_buf_ptr += count; - tty->flip.flag_buf_ptr += count; - tty->flip.count += count; + count -= 2; + tty_insert_flip_string(tty, raw->inbuf, count); tty_flip_buffer_push(raw->tty); break; } @@ -727,8 +719,7 @@ raw3215_remove (struct ccw_device *cdev) raw = cdev->dev.driver_data; if (raw) { cdev->dev.driver_data = NULL; - if (raw->buffer) - kfree(raw->buffer); + kfree(raw->buffer); kfree(raw); } } @@ -874,7 +865,7 @@ con3215_init(void) } cdev = ccw_device_probe_console(); - if (!cdev) + if (IS_ERR(cdev)) return -ENODEV; raw3215[0] = raw = (struct raw3215_info *)