From 524aa2ad320cd79aa3be339098076c0abe9fb276 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 30 Jan 2011 18:13:39 +0000 Subject: xpp: use phonedev_cleanup() instead of inline code Signed-off-by: Oron Peled Acked-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9711 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/xpp_dahdi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/dahdi/xpp') diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c index c587219..ba36c80 100644 --- a/drivers/dahdi/xpp/xpp_dahdi.c +++ b/drivers/dahdi/xpp/xpp_dahdi.c @@ -67,6 +67,8 @@ static DEF_PARM_BOOL(prefmaster, 0, 0644, "Do we want to be dahdi preferred sync #include "dahdi_debug.h" +static void phonedev_cleanup(xpd_t *xpd); + #ifdef DEBUG_SYNC_PARPORT /* * Use parallel port to sample our PCM sync and diagnose quality and @@ -238,7 +240,6 @@ err: void xpd_free(xpd_t *xpd) { xbus_t *xbus = NULL; - unsigned int x; if(!xpd) return; @@ -251,10 +252,7 @@ void xpd_free(xpd_t *xpd) XPD_DBG(DEVICES, xpd, "\n"); xpd_proc_remove(xbus, xpd); xbus_xpd_unbind(xbus, xpd); - for (x = 0; x < PHONEDEV(xpd).channels; x++) { - if (PHONEDEV(xpd).chans[x]) - KZFREE(PHONEDEV(xpd).chans[x]); - } + phonedev_cleanup(xpd); KZFREE(xpd); DBG(DEVICES, "refcount_xbus=%d\n", refcount_xbus(xbus)); /* -- cgit v1.2.3