diff options
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/fbcon.c | 35 | ||||
-rw-r--r-- | drivers/video/console/mdacon.c | 8 | ||||
-rw-r--r-- | drivers/video/console/newport_con.c | 9 | ||||
-rw-r--r-- | drivers/video/console/sticon.c | 6 |
4 files changed, 21 insertions, 37 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index a92783e480e6..d55b33757465 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -556,34 +556,6 @@ static int do_fbcon_takeover(int show_logo) return err; } -static int fbcon_takeover(int show_logo) -{ - int err, i; - - if (!num_registered_fb) - return -ENODEV; - - if (!show_logo) - logo_shown = FBCON_LOGO_DONTSHOW; - - for (i = first_fb_vc; i <= last_fb_vc; i++) - con2fb_map[i] = info_idx; - - err = take_over_console(&fb_con, first_fb_vc, last_fb_vc, - fbcon_is_default); - - if (err) { - for (i = first_fb_vc; i <= last_fb_vc; i++) { - con2fb_map[i] = -1; - } - info_idx = -1; - } else { - fbcon_has_console_bind = 1; - } - - return err; -} - #ifdef MODULE static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, int cols, int rows, int new_cols, int new_rows) @@ -901,7 +873,7 @@ static int set_con2fb_map(int unit, int newidx, int user) /* * Low Level Operations */ -/* NOTE: fbcon cannot be __init: it may be called from take_over_console later */ +/* NOTE: fbcon cannot be __init: it may be called from do_take_over_console later */ static int var_to_display(struct display *disp, struct fb_var_screeninfo *var, struct fb_info *info) @@ -3543,8 +3515,9 @@ static void fbcon_start(void) } } + do_fbcon_takeover(0); console_unlock(); - fbcon_takeover(0); + } } @@ -3648,8 +3621,8 @@ static void __exit fb_console_exit(void) fbcon_deinit_device(); device_destroy(fb_class, MKDEV(0, 0)); fbcon_exit(); + do_unregister_con_driver(&fb_con); console_unlock(); - unregister_con_driver(&fb_con); } module_exit(fb_console_exit); diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c index 0b67866cae10..296e94561556 100644 --- a/drivers/video/console/mdacon.c +++ b/drivers/video/console/mdacon.c @@ -585,10 +585,14 @@ static const struct consw mda_con = { int __init mda_console_init(void) { + int err; + if (mda_first_vc > mda_last_vc) return 1; - - return take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0); + console_lock(); + err = do_take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0); + console_unlock(); + return err; } static void __exit mda_console_exit(void) diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c index b05afd03729e..a6ab9299813c 100644 --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c @@ -297,7 +297,7 @@ static void newport_exit(void) 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; @@ -746,6 +746,7 @@ static int newport_probe(struct gio_device *dev, const struct gio_device_id *id) { unsigned long newport_addr; + int err; if (!dev->resource.start) return -EINVAL; @@ -759,8 +760,10 @@ static int newport_probe(struct gio_device *dev, 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) diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index 491c1c1baf4c..5f65ca3d8564 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c @@ -372,6 +372,7 @@ static const struct consw sti_con = { static int __init sticonsole_init(void) { + int err; /* already initialized ? */ if (sticon_sti) return 0; @@ -382,7 +383,10 @@ static int __init sticonsole_init(void) if (conswitchp == &dummy_con) { printk(KERN_INFO "sticon: Initializing STI text console.\n"); - return take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1, 1); + console_lock(); + err = do_take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1, 1); + console_unlock(); + return err; } return 0; } |