summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-03 18:25:32 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-03 18:25:32 +0000
commitd185d797c99be49d5c4228359c7e8a724f506048 (patch)
treec22f90f94aed8df0133bdafcbf1e3d051bc27490 /include
parent44213fdd12da2e4ae406a26562b26d6e8d8e8d00 (diff)
dahdi_dynamic: dynamic drivers should not reference count themselves.
Move the try_module_get/module_put calls from the various dynamic drivers into the "core" dahdi_dynamic.c file itself. This way, a reference count can always be held while calling through the function pointers. This is enabled by adding an .owner field to 'struct dahdi_dynamic_driver'. Dynamic spans are also unique in dahdi in that they require a "dahdi_cfg -s" to stop them and release the references on the modules. This is counterintuitive. This change makes sure they are reference counted just like other spans and on driver unload, if there aren't any open handles from userspace, they will take care of unwinding themselves. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9573 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 863ad04..24bb1b4 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1006,6 +1006,7 @@ struct dahdi_dynamic_driver {
int (*flush)(void);
struct list_head list;
+ struct module *owner;
};
/*! \brief Receive a dynamic span message */