--- zzzz-none-000/linux-3.10.107/drivers/video/console/newport_con.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/video/console/newport_con.c 2021-02-04 17:41:59.000000000 +0000 @@ -297,7 +297,7 @@ newport_set_def_font(i, NULL); } -/* Can't be __init, take_over_console may call it later */ +/* Can't be __init, do_take_over_console may call it later */ static const char *newport_startup(void) { int i; @@ -687,7 +687,7 @@ static void newport_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, int h, int w) { - short xs, ys, xe, ye, xoffs, yoffs, tmp; + short xs, ys, xe, ye, xoffs, yoffs; xs = sx << 3; xe = ((sx + w) << 3) - 1; @@ -701,9 +701,7 @@ yoffs = (dy - sy) << 4; if (xoffs > 0) { /* move to the right, exchange starting points */ - tmp = xe; - xe = xs; - xs = tmp; + swap(xe, xs); } newport_wait(npregs); npregs->set.drawmode0 = (NPORT_DMODE0_S2S | NPORT_DMODE0_BLOCK | @@ -746,6 +744,7 @@ const struct gio_device_id *id) { unsigned long newport_addr; + int err; if (!dev->resource.start) return -EINVAL; @@ -759,8 +758,10 @@ npregs = (struct newport_regs *)/* ioremap cannot fail */ ioremap(newport_addr, sizeof(struct newport_regs)); - - return take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1); + console_lock(); + err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1); + console_unlock(); + return err; } static void newport_remove(struct gio_device *dev)