lkml.org 
[lkml]   [2002]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectmdacon.c minor cleanups
Hi

Im resending mdacon.c patch if anyone is interested including it..

Its just a small cleanup(a part of kernel-janitor TODO).
Added module description, module_init/exit(), printk() parameters,...
Tested on 2.4.x, but not on 2.5(patches/compiles fine..)

Flames/improvements welcome..

Boris B.


--- drivers/video/mdacon.c.orig Fri Sep 14 01:04:43 2001
+++ drivers/video/mdacon.c Thu Feb 14 18:07:20 2002
@@ -78,7 +78,7 @@
static int mda_first_vc = 13;
static int mda_last_vc = 16;

-static struct vc_data *mda_display_fg = NULL;
+static struct vc_data *mda_display_fg;

MODULE_PARM(mda_first_vc, "1-255i");
MODULE_PARM(mda_last_vc, "1-255i");
@@ -338,7 +338,7 @@
mda_type_name = "MDA";

if (! mda_detect()) {
- printk("mdacon: MDA card not detected.\n");
+ printk(KERN_WARNING __FILE__ ": MDA card not detected.\n");
return NULL;
}

@@ -349,7 +349,7 @@
/* cursor looks ugly during boot-up, so turn it off */
mda_set_cursor(mda_vram_len - 1);

- printk("mdacon: %s with %ldK of memory detected.\n",
+ printk(KERN_INFO __FILE__ ": %s with %ldK of memory detected.\n",
mda_type_name, mda_vram_len/1024);

return "MDA-2";
@@ -605,28 +605,23 @@
con_invert_region: mdacon_invert_region,
};

-void __init mda_console_init(void)
+int __init mda_console_init(void)
{
if (mda_first_vc > mda_last_vc)
- return;
+ return -EINVAL;

take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0);
-}
-
-#ifdef MODULE
-
-MODULE_LICENSE("GPL");
-
-int init_module(void)
-{
- mda_console_init();
-
return 0;
}

-void cleanup_module(void)
+void __exit mda_console_exit(void)
{
give_up_console(&mda_con);
}

+#ifdef MODULE
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("MDA console driver. Default console allocation: vc/13 - vc/16");
+module_init(mda_console_init);
+module_exit(mda_console_exit);
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.067 / U:5.500 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site