diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-01-03 18:25:32 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-01-03 18:25:32 +0000 |
commit | 3a9d1ce0841ccaf849a3b13d4043f80e1030c88a (patch) | |
tree | c22f90f94aed8df0133bdafcbf1e3d051bc27490 /include | |
parent | e49000fed5cacda3dd5a704de4211a6335666982 (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.h | 1 |
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 */ |