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
This commit is contained in:
@@ -1006,6 +1006,7 @@ struct dahdi_dynamic_driver {
|
||||
int (*flush)(void);
|
||||
|
||||
struct list_head list;
|
||||
struct module *owner;
|
||||
};
|
||||
|
||||
/*! \brief Receive a dynamic span message */
|
||||
|
||||
Reference in New Issue
Block a user