summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcte11xp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dahdi/wcte11xp.c')
-rw-r--r--drivers/dahdi/wcte11xp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c
index 16c216f..32d4f5b 100644
--- a/drivers/dahdi/wcte11xp.c
+++ b/drivers/dahdi/wcte11xp.c
@@ -442,9 +442,14 @@ static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
return 0;
}
+static inline struct t1 *t1_from_span(struct dahdi_span *span)
+{
+ return container_of(span, struct t1, span);
+}
+
static int t1xxp_maint(struct dahdi_span *span, int cmd)
{
- struct t1 *wc = span->pvt;
+ struct t1 *wc = t1_from_span(span);
if (wc->spantype == TYPE_E1) {
switch(cmd) {
@@ -881,7 +886,7 @@ static void t1xxp_framer_start(struct t1 *wc, struct dahdi_span *span)
static int t1xxp_startup(struct dahdi_span *span)
{
- struct t1 *wc = span->pvt;
+ struct t1 *wc = t1_from_span(span);
int i,alreadyrunning = span->flags & DAHDI_FLAG_RUNNING;
@@ -909,7 +914,7 @@ static int t1xxp_startup(struct dahdi_span *span)
static int t1xxp_shutdown(struct dahdi_span *span)
{
- struct t1 *wc = span->pvt;
+ struct t1 *wc = t1_from_span(span);
unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
@@ -939,7 +944,7 @@ static int t1xxp_chanconfig(struct dahdi_chan *chan, int sigtype)
static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
- struct t1 *wc = span->pvt;
+ struct t1 *wc = t1_from_span(span);
/* Do we want to SYNC on receive or not */
wc->sync = (lc->sync) ? 1 : 0;
@@ -997,7 +1002,6 @@ static int t1xxp_software_init(struct t1 *wc)
wc->span.chans = wc->chans;
wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ioctl = t1xxp_ioctl;
- wc->span.pvt = wc;
init_waitqueue_head(&wc->span.maintq);
for (x=0;x<wc->span.channels;x++) {
sprintf(wc->chans[x]->name, "WCT1/%d/%d", wc->num, x + 1);