[dahdi-commits] sruffell: branch linux/sruffell/improved_ecreference r6960 - /linux/team/sruf...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Aug 11 15:25:11 CDT 2009
Author: sruffell
Date: Tue Aug 11 15:25:07 2009
New Revision: 6960
URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=6960
Log:
wcte12xp-wip: Cleanup after ourselves after a failed start.
Also, no need to prestuff the fifo at start.
Modified:
linux/team/sruffell/improved_ecreference/drivers/dahdi/wcte12xp/base.c
Modified: linux/team/sruffell/improved_ecreference/drivers/dahdi/wcte12xp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/team/sruffell/improved_ecreference/drivers/dahdi/wcte12xp/base.c?view=diff&rev=6960&r1=6959&r2=6960
==============================================================================
--- linux/team/sruffell/improved_ecreference/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/team/sruffell/improved_ecreference/drivers/dahdi/wcte12xp/base.c Tue Aug 11 15:25:07 2009
@@ -650,8 +650,10 @@
free_cmd(wc, cmd);
}
- for (x = 0; x < ARRAY_SIZE(wc->ec_reference); ++x)
- kfifo_free(wc->ec_reference[x]);
+ for (x = 0; x < ARRAY_SIZE(wc->ec_reference); ++x) {
+ if (wc->ec_reference[x])
+ kfifo_free(wc->ec_reference[x]);
+ }
kfree(wc);
}
@@ -884,23 +886,6 @@
static int t1xxp_startup(struct dahdi_span *span)
{
struct t1 *wc = span->pvt;
- int i;
- int x;
- unsigned char buffer[DAHDI_CHUNKSIZE];
-
- /* initialize the start value for the entire chunk of last ec buffer */
- for (i = 0; i < span->channels; i++) {
- __kfifo_reset(wc->ec_reference[i]);
- for (x = 0; x < DAHDI_CHUNKSIZE; ++x)
- buffer[x] = DAHDI_LIN2X(0, span->chans[i]);
-
- for (x = 0; x < __kfifo_len(wc->ec_reference[i]);
- x += DAHDI_CHUNKSIZE) {
- __kfifo_put(wc->ec_reference[i], buffer,
- ARRAY_SIZE(buffer));
- }
- }
-
/* Reset framer with proper parameters and start */
t1xxp_framer_start(wc, span);
debug_printk(1, "Calling startup (flags is %lu)\n", span->flags);
@@ -1756,6 +1741,14 @@
wc->ec_reference[x] = kfifo_alloc(DAHDI_CHUNKSIZE *
VOICEBUS_MAX_LATENCY,
GFP_KERNEL, &wc->reglock);
+
+ if (IS_ERR(wc->ec_reference[x])) {
+ res = PTR_ERR(wc->ec_reference[x]);
+ wc->ec_reference[x] = NULL;
+ free_wc(wc);
+ return res;
+ }
+
}
snprintf(wc->name, sizeof(wc->name)-1, "wcte12xp%d", index);
More information about the dahdi-commits
mailing list