Commit 7f589925 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds
Browse files

[PATCH] Char: mxser_new, debug printk dependent on DEBUG



Print some debug info only when DEBUG is enabled (use pr_debug macro).
Eliminate verbose kernel parameter which takes care of this.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e7eafa32
...@@ -244,7 +244,6 @@ MODULE_DEVICE_TABLE(pci, mxser_pcibrds); ...@@ -244,7 +244,6 @@ MODULE_DEVICE_TABLE(pci, mxser_pcibrds);
static int ioaddr[MXSER_BOARDS] = { 0, 0, 0, 0 }; static int ioaddr[MXSER_BOARDS] = { 0, 0, 0, 0 };
static int ttymajor = MXSERMAJOR; static int ttymajor = MXSERMAJOR;
static int calloutmajor = MXSERCUMAJOR; static int calloutmajor = MXSERCUMAJOR;
static int verbose = 0;
/* Variables for insmod */ /* Variables for insmod */
...@@ -252,7 +251,6 @@ MODULE_AUTHOR("Casper Yang"); ...@@ -252,7 +251,6 @@ MODULE_AUTHOR("Casper Yang");
MODULE_DESCRIPTION("MOXA Smartio/Industio Family Multiport Board Device Driver"); MODULE_DESCRIPTION("MOXA Smartio/Industio Family Multiport Board Device Driver");
module_param_array(ioaddr, int, NULL, 0); module_param_array(ioaddr, int, NULL, 0);
module_param(ttymajor, int, 0); module_param(ttymajor, int, 0);
module_param(verbose, bool, 0);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
struct mxser_log { struct mxser_log {
...@@ -493,11 +491,9 @@ static int __init mxser_module_init(void) ...@@ -493,11 +491,9 @@ static int __init mxser_module_init(void)
{ {
int ret; int ret;
if (verbose) pr_debug("Loading module mxser ...\n");
printk(KERN_DEBUG "Loading module mxser ...\n");
ret = mxser_init(); ret = mxser_init();
if (verbose) pr_debug("Done.\n");
printk(KERN_DEBUG "Done.\n");
return ret; return ret;
} }
...@@ -505,8 +501,7 @@ static void __exit mxser_module_exit(void) ...@@ -505,8 +501,7 @@ static void __exit mxser_module_exit(void)
{ {
int i, err; int i, err;
if (verbose) pr_debug("Unloading module mxser ...\n");
printk(KERN_DEBUG "Unloading module mxser ...\n");
err = tty_unregister_driver(mxvar_sdriver); err = tty_unregister_driver(mxvar_sdriver);
if (!err) if (!err)
...@@ -532,8 +527,7 @@ static void __exit mxser_module_exit(void) ...@@ -532,8 +527,7 @@ static void __exit mxser_module_exit(void)
} }
} }
} }
if (verbose) pr_debug("Done.\n");
printk(KERN_DEBUG "Done.\n");
} }
static void process_txrx_fifo(struct mxser_port *info) static void process_txrx_fifo(struct mxser_port *info)
...@@ -562,10 +556,7 @@ static int __devinit mxser_initbrd(struct mxser_board *brd) ...@@ -562,10 +556,7 @@ static int __devinit mxser_initbrd(struct mxser_board *brd)
unsigned int i; unsigned int i;
int retval; int retval;
/*if (verbose) */ { printk(KERN_INFO "max. baud rate = %d bps.\n", brd->ports[0].max_baud);
printk(" max. baud rate = %d bps.\n",
brd->ports[0].max_baud);
}
for (i = 0; i < brd->nports; i++) { for (i = 0; i < brd->nports; i++) {
info = &brd->ports[i]; info = &brd->ports[i];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment