summaryrefslogtreecommitdiff
path: root/drivers/staging/batman-adv/main.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2009-12-12 23:39:41 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-03 16:42:29 -0800
commitbad2239e87d73fd999a9c5d5efa5024b16046c6c (patch)
tree17cd4a7f9a6f20cbde6e494d903e392561dddf00 /drivers/staging/batman-adv/main.c
parente89230ec9154870a165de7e4acc411e1e7eec345 (diff)
Staging: batman-adv: replace internal logging mechanism.
batman-adv used its own logging infrastructure. Replace this with standard kernel logging, printk(), with compile time and runtime options to enable/disable different debug levels. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/main.c')
-rw-r--r--drivers/staging/batman-adv/main.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index bb89bfc5dda6..4b93a5d33cf9 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -21,7 +21,6 @@
#include "main.h"
#include "proc.h"
-#include "log.h"
#include "routing.h"
#include "send.h"
#include "soft-interface.h"
@@ -57,6 +56,17 @@ atomic_t module_state;
struct workqueue_struct *bat_event_workqueue;
+#ifdef CONFIG_BATMAN_DEBUG
+int debug;
+
+module_param(debug, int, 0644);
+
+int bat_debug_type(int type)
+{
+ return debug & type;
+}
+#endif
+
int init_module(void)
{
int retval;
@@ -90,21 +100,21 @@ int init_module(void)
interface_setup);
if (!soft_device) {
- debug_log(LOG_TYPE_CRIT, "Unable to allocate the batman interface\n");
+ printk(KERN_ERR "batman-adv:Unable to allocate the batman interface\n");
goto end;
}
retval = register_netdev(soft_device);
if (retval < 0) {
- debug_log(LOG_TYPE_CRIT, "Unable to register the batman interface: %i\n", retval);
+ printk(KERN_ERR "batman-adv:Unable to register the batman interface: %i\n", retval);
goto free_soft_device;
}
register_netdevice_notifier(&hard_if_notifier);
- debug_log(LOG_TYPE_CRIT, "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded \n",
- SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+ printk(KERN_INFO "batman-adv:B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded \n",
+ SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
return 0;
@@ -156,7 +166,7 @@ void activate_module(void)
kthread_task = kthread_run(packet_recv_thread, NULL, "batman-adv");
if (IS_ERR(kthread_task)) {
- debug_log(LOG_TYPE_CRIT, "Unable to start packet receive thread\n");
+ printk(KERN_ERR "batman-adv:Unable to start packet receive thread\n");
kthread_task = NULL;
}
}
@@ -166,7 +176,7 @@ void activate_module(void)
goto end;
err:
- debug_log(LOG_TYPE_CRIT, "Unable to allocate memory for mesh information structures: out of mem ?\n");
+ printk(KERN_ERR "batman-adv:Unable to allocate memory for mesh information structures: out of mem ?\n");
shutdown_module();
end:
return;