fbcon: convert last two unregister_con_driver call to do_unregister_con_driver
[deliverable/linux.git] / drivers / tty / vt / vt.c
index fbd447b390f775fa8182a290266d3d4f41f46e2c..8f4a71aa971e63a32dbd1423de43538ba5fec94d 100644 (file)
@@ -3088,17 +3088,6 @@ err:
 };
 
 
-static int bind_con_driver(const struct consw *csw, int first, int last,
-                          int deflt)
-{
-       int ret;
-
-       console_lock();
-       ret = do_bind_con_driver(csw, first, last, deflt);
-       console_unlock();
-       return ret;
-}
-
 #ifdef CONFIG_VT_HW_CONSOLE_BINDING
 static int con_is_graphics(const struct consw *csw, int first, int last)
 {
@@ -3116,34 +3105,6 @@ static int con_is_graphics(const struct consw *csw, int first, int last)
        return retval;
 }
 
-/**
- * unbind_con_driver - unbind a console driver
- * @csw: pointer to console driver to unregister
- * @first: first in range of consoles that @csw should be unbound from
- * @last: last in range of consoles that @csw should be unbound from
- * @deflt: should next bound console driver be default after @csw is unbound?
- *
- * To unbind a driver from all possible consoles, pass 0 as @first and
- * %MAX_NR_CONSOLES as @last.
- *
- * @deflt controls whether the console that ends up replacing @csw should be
- * the default console.
- *
- * RETURNS:
- * -ENODEV if @csw isn't a registered console driver or can't be unregistered
- * or 0 on success.
- */
-int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
-{
-       int retval;
-
-       console_lock();
-       retval = do_unbind_con_driver(csw, first, last, deflt);
-       console_unlock();
-       return retval;
-}
-EXPORT_SYMBOL(unbind_con_driver);
-
 /* unlocked version of unbind_con_driver() */
 int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
 {
@@ -3264,8 +3225,11 @@ static int vt_bind(struct con_driver *con)
                if (first == 0 && last == MAX_NR_CONSOLES -1)
                        deflt = 1;
 
-               if (first != -1)
-                       bind_con_driver(csw, first, last, deflt);
+               if (first != -1) {
+                       console_lock();
+                       do_bind_con_driver(csw, first, last, deflt);
+                       console_unlock();
+               }
 
                first = -1;
                last = -1;
@@ -3303,8 +3267,11 @@ static int vt_unbind(struct con_driver *con)
                if (first == 0 && last == MAX_NR_CONSOLES -1)
                        deflt = 1;
 
-               if (first != -1)
-                       unbind_con_driver(csw, first, last, deflt);
+               if (first != -1) {
+                       console_lock();
+                       do_unbind_con_driver(csw, first, last, deflt);
+                       console_unlock();
+               }
 
                first = -1;
                last = -1;
@@ -3576,26 +3543,6 @@ err:
        return retval;
 }
 
-/**
- * register_con_driver - register console driver to console layer
- * @csw: console driver
- * @first: the first console to take over, minimum value is 0
- * @last: the last console to take over, maximum value is MAX_NR_CONSOLES -1
- *
- * DESCRIPTION: This function registers a console driver which can later
- * bind to a range of consoles specified by @first and @last. It will
- * also initialize the console driver by calling con_startup().
- */
-int register_con_driver(const struct consw *csw, int first, int last)
-{
-       int retval;
-
-       console_lock();
-       retval = do_register_con_driver(csw, first, last);
-       console_unlock();
-       return retval;
-}
-EXPORT_SYMBOL(register_con_driver);
 
 /**
  * unregister_con_driver - unregister console driver from console layer
@@ -3677,30 +3624,6 @@ int do_take_over_console(const struct consw *csw, int first, int last, int deflt
 }
 EXPORT_SYMBOL_GPL(do_take_over_console);
 
-/*
- *     If we support more console drivers, this function is used
- *     when a driver wants to take over some existing consoles
- *     and become default driver for newly opened ones.
- *
- *     take_over_console is basically a register followed by unbind
- */
-int take_over_console(const struct consw *csw, int first, int last, int deflt)
-{
-       int err;
-
-       err = register_con_driver(csw, first, last);
-       /*
-        * If we get an busy error we still want to bind the console driver
-        * and return success, as we may have unbound the console driver
-        * but not unregistered it.
-        */
-       if (err == -EBUSY)
-               err = 0;
-       if (!err)
-               bind_con_driver(csw, first, last, deflt);
-
-       return err;
-}
 
 /*
  * give_up_console is a wrapper to unregister_con_driver. It will only
@@ -3708,7 +3631,9 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt)
  */
 void give_up_console(const struct consw *csw)
 {
-       unregister_con_driver(csw);
+       console_lock();
+       do_unregister_con_driver(csw);
+       console_unlock();
 }
 
 static int __init vtconsole_class_init(void)
@@ -4264,6 +4189,5 @@ EXPORT_SYMBOL(console_blanked);
 EXPORT_SYMBOL(vc_cons);
 EXPORT_SYMBOL(global_cursor_default);
 #ifndef VT_SINGLE_DRIVER
-EXPORT_SYMBOL(take_over_console);
 EXPORT_SYMBOL(give_up_console);
 #endif
This page took 0.026459 seconds and 5 git commands to generate.