summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/ap400/ap400_drv.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/dahdi/ap400/ap400_drv.c b/drivers/dahdi/ap400/ap400_drv.c
index 2fd0eaa..ba0f6b4 100644
--- a/drivers/dahdi/ap400/ap400_drv.c
+++ b/drivers/dahdi/ap400/ap400_drv.c
@@ -750,9 +750,13 @@ static int ap4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long da
return 0;
}
+static inline struct ap4_span* ap4_span_from_span(struct dahdi_span *span) {
+ return container_of(span, struct ap4_span, span);
+}
+
static int ap4_maint(struct dahdi_span *span, int cmd)
{
- struct ap4_span *ts = span->pvt;
+ struct ap4_span *ts = ap4_span_from_span(span);
struct ap4 *wc = ts->owner;
@@ -894,7 +898,7 @@ static int ap4_shutdown(struct dahdi_span *span)
int tspan;
int wasrunning;
unsigned long flags;
- struct ap4_span *ts = span->pvt;
+ struct ap4_span *ts = ap4_span_from_span(span);
struct ap4 *wc = ts->owner;
tspan = span->offset + 1;
@@ -935,7 +939,7 @@ static int ap4_shutdown(struct dahdi_span *span)
static int ap4_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
int i;
- struct ap4_span *ts = span->pvt;
+ struct ap4_span *ts = ap4_span_from_span(span);
struct ap4 *wc = ts->owner;
unsigned int val;
@@ -1058,7 +1062,6 @@ static void init_spans(struct ap4 *wc)
#ifdef APEC_SUPPORT
ts->span.echocan = ap4_echocan;
#endif
- ts->span.pvt = ts;
ts->owner = wc;
ts->span.offset = x;
ts->writechunk = (void *)(wc->writechunk + x * 32 * 2);
@@ -1255,7 +1258,7 @@ static int ap4_startup(struct dahdi_span *span)
int tspan;
unsigned long flags;
int alreadyrunning;
- struct ap4_span *ts = span->pvt;
+ struct ap4_span *ts = ap4_span_from_span(span);
struct ap4 *wc = ts->owner;
printk("About to enter startup!\n");