summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2009-02-09 05:58:55 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2009-02-09 05:58:55 +0000
commit62b0f742f8b8bebd57cbb43f96348afb11ee801a (patch)
tree4d6ca258aa1cd53ee39bce6f1e7701dbd8746fd1
parentdca65b170fb0dbd19693473678a25216cb2fc2f5 (diff)
Fix building Zaptel with module unloading disabled
As moduel_refcount is only used for debugging, disable it in this non-common case. (Issue #14402) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4625 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--kernel/xpp/xproto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/xpp/xproto.c b/kernel/xpp/xproto.c
index ae6a9b2..05735e9 100644
--- a/kernel/xpp/xproto.c
+++ b/kernel/xpp/xproto.c
@@ -93,7 +93,9 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype)
}
if(xtable) {
BUG_ON(!xtable->owner);
+#ifdef CONFIG_MODULE_UNLOAD
DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner));
+#endif
if(!try_module_get(xtable->owner)) {
ERR("%s: try_module_get for %s failed.\n", __FUNCTION__, xtable->name);
return NULL;
@@ -105,8 +107,10 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype)
void xproto_put(const xproto_table_t *xtable)
{
BUG_ON(!xtable);
+#ifdef CONFIG_MODULE_UNLOAD
DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner));
BUG_ON(module_refcount(xtable->owner) <= 0);
+#endif
module_put(xtable->owner);
}