vserver 1.9.5.x5
[linux-2.6.git] / drivers / video / console / mdacon.c
index 8e30b24..be3d535 100644 (file)
@@ -47,7 +47,7 @@
 #include <asm/io.h>
 #include <asm/vga.h>
 
-static spinlock_t mda_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mda_lock);
 
 /* description of the hardware layout */
 
@@ -64,7 +64,6 @@ static unsigned int   mda_gfx_port;           /* Graphics control port */
 
 /* current hardware state */
 
-static int     mda_origin_loc=-1;
 static int     mda_cursor_loc=-1;
 static int     mda_cursor_size_from=-1;
 static int     mda_cursor_size_to=-1;
@@ -79,8 +78,8 @@ static int    mda_last_vc  = 16;
 
 static struct vc_data  *mda_display_fg = NULL;
 
-MODULE_PARM(mda_first_vc, "1-255i");
-MODULE_PARM(mda_last_vc,  "1-255i");
+module_param(mda_first_vc, int, 0);
+module_param(mda_last_vc, int, 0);
 
 /* MDA register values
  */
@@ -148,16 +147,6 @@ static int test_mda_b(unsigned char val, unsigned char reg)
 }
 #endif
 
-static inline void mda_set_origin(unsigned int location)
-{
-       if (mda_origin_loc == location)
-               return;
-
-       write_mda_w(location >> 1, 0x0c);
-
-       mda_origin_loc = location;
-}
-
 static inline void mda_set_cursor(unsigned int location) 
 {
        if (mda_cursor_loc == location)
@@ -370,8 +359,6 @@ static void mdacon_init(struct vc_data *c, int init)
 
        if (mda_display_fg == NULL)
                mda_display_fg = c;
-
-       MOD_INC_USE_COUNT;
 }
 
 static void mdacon_deinit(struct vc_data *c)
@@ -380,8 +367,6 @@ static void mdacon_deinit(struct vc_data *c)
 
        if (mda_display_fg == c)
                mda_display_fg = NULL;
-
-       MOD_DEC_USE_COUNT;
 }
 
 static inline u16 mda_convert_attr(u16 ch)
@@ -521,11 +506,6 @@ static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
        }
 }
 
-static int mdacon_font_op(struct vc_data *c, struct console_font_op *op)
-{
-       return -ENOSYS;
-}
-
 static int mdacon_scrolldelta(struct vc_data *c, int lines)
 {
        return 0;
@@ -586,6 +566,7 @@ static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines)
  */
 
 const struct consw mda_con = {
+       .owner =                THIS_MODULE,
        .con_startup =          mdacon_startup,
        .con_init =             mdacon_init,
        .con_deinit =           mdacon_deinit,
@@ -597,7 +578,6 @@ const struct consw mda_con = {
        .con_bmove =            mdacon_bmove,
        .con_switch =           mdacon_switch,
        .con_blank =            mdacon_blank,
-       .con_font_op =          mdacon_font_op,
        .con_set_palette =      mdacon_set_palette,
        .con_scrolldelta =      mdacon_scrolldelta,
        .con_build_attr =       mdacon_build_attr,
@@ -609,8 +589,7 @@ int __init mda_console_init(void)
        if (mda_first_vc > mda_last_vc)
                return 1;
 
-       take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0);
-       return 0;
+       return take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0);
 }
 
 void __exit mda_console_exit(void)