summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wct1xxp.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-07-26 00:30:39 +0000
committerShaun Ruffell <sruffell@digium.com>2010-07-26 00:30:39 +0000
commit8682c2a90bd996765326fb6477a2466b63530b73 (patch)
tree384ce57c53c650294c490cda43b5ea7e624685cc /drivers/dahdi/wct1xxp.c
parent5c45b4da59502f5a30f3eb01e431d92d3d1c2202 (diff)
dahdi: Remove the 'pvt' member from dahdi_span.
The vast majority of board drivers already keep the dahdi_span structure in a driver specific structure. The others were easily converted. This way board drivers can use the container_of macro to find what was previously pointed to by the "pvt" member of the span. One less thing to think about in the span structure. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8984 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wct1xxp.c')
-rw-r--r--drivers/dahdi/wct1xxp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c
index 8db70e0..30d6457 100644
--- a/drivers/dahdi/wct1xxp.c
+++ b/drivers/dahdi/wct1xxp.c
@@ -604,9 +604,14 @@ static int t1xxp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
}
}
+static inline struct t1xxp *t1xxp_from_span(struct dahdi_span *span)
+{
+ return container_of(span, struct t1xxp, span);
+}
+
static int t1xxp_startup(struct dahdi_span *span)
{
- struct t1xxp *wc = span->pvt;
+ struct t1xxp *wc = t1xxp_from_span(span);
int i,alreadyrunning = span->flags & DAHDI_FLAG_RUNNING;
@@ -637,7 +642,7 @@ static int t1xxp_startup(struct dahdi_span *span)
static int t1xxp_shutdown(struct dahdi_span *span)
{
- struct t1xxp *wc = span->pvt;
+ struct t1xxp *wc = t1xxp_from_span(span);
unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
@@ -652,7 +657,7 @@ static int t1xxp_shutdown(struct dahdi_span *span)
static int t1xxp_maint(struct dahdi_span *span, int cmd)
{
- struct t1xxp *wc = span->pvt;
+ struct t1xxp *wc = t1xxp_from_span(span);
int res = 0;
unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
@@ -730,7 +735,7 @@ static int t1xxp_chanconfig(struct dahdi_chan *chan, int sigtype)
static int t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
- struct t1xxp *wc = span->pvt;
+ struct t1xxp *wc = t1xxp_from_span(span);
/* Do we want to SYNC on receive or not */
wc->sync = (lc->sync) ? 1 : 0;
@@ -772,7 +777,6 @@ static int t1xxp_software_init(struct t1xxp *wc)
wc->span.chans = wc->chans;
wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ioctl = t1xxp_ioctl;
- wc->span.pvt = wc;
if (wc->ise1) {
wc->span.channels = 31;
wc->span.deflaw = DAHDI_LAW_ALAW;