xpp: use phonedev_cleanup() instead of inline code

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9711 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Oron Peled 2011-01-30 18:13:39 +00:00 committed by Tzafrir Cohen
parent c94f184673
commit e208a25a7c

View File

@ -67,6 +67,8 @@ static DEF_PARM_BOOL(prefmaster, 0, 0644, "Do we want to be dahdi preferred sync
#include "dahdi_debug.h" #include "dahdi_debug.h"
static void phonedev_cleanup(xpd_t *xpd);
#ifdef DEBUG_SYNC_PARPORT #ifdef DEBUG_SYNC_PARPORT
/* /*
* Use parallel port to sample our PCM sync and diagnose quality and * Use parallel port to sample our PCM sync and diagnose quality and
@ -238,7 +240,6 @@ err:
void xpd_free(xpd_t *xpd) void xpd_free(xpd_t *xpd)
{ {
xbus_t *xbus = NULL; xbus_t *xbus = NULL;
unsigned int x;
if(!xpd) if(!xpd)
return; return;
@ -251,10 +252,7 @@ void xpd_free(xpd_t *xpd)
XPD_DBG(DEVICES, xpd, "\n"); XPD_DBG(DEVICES, xpd, "\n");
xpd_proc_remove(xbus, xpd); xpd_proc_remove(xbus, xpd);
xbus_xpd_unbind(xbus, xpd); xbus_xpd_unbind(xbus, xpd);
for (x = 0; x < PHONEDEV(xpd).channels; x++) { phonedev_cleanup(xpd);
if (PHONEDEV(xpd).chans[x])
KZFREE(PHONEDEV(xpd).chans[x]);
}
KZFREE(xpd); KZFREE(xpd);
DBG(DEVICES, "refcount_xbus=%d\n", refcount_xbus(xbus)); DBG(DEVICES, "refcount_xbus=%d\n", refcount_xbus(xbus));
/* /*