summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-02-09 06:03:25 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-02-09 06:03:25 +0000
commitdc3382332f7d53ea44429b30cd9523ead9881217 (patch)
treef47514f6da70c36264ab83e9cc60ae5c557d3d2a
parent2e68d97af5f4ae25bcb0ca6b65e4cfc9361d0470 (diff)
Fix building DAHDI with module unloading disabled
As moduel_refcount is only used for debugging, disable it in this non-common case. (Closes issue #14402) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5987 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/xpp/xproto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/dahdi/xpp/xproto.c b/drivers/dahdi/xpp/xproto.c
index 3b454b1..bf51f23 100644
--- a/drivers/dahdi/xpp/xproto.c
+++ b/drivers/dahdi/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);
}