diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-07-26 00:30:39 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-07-26 00:30:39 +0000 |
commit | 8682c2a90bd996765326fb6477a2466b63530b73 (patch) | |
tree | 384ce57c53c650294c490cda43b5ea7e624685cc /drivers/dahdi/xpp | |
parent | 5c45b4da59502f5a30f3eb01e431d92d3d1c2202 (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/xpp')
-rw-r--r-- | drivers/dahdi/xpp/card_bri.c | 6 | ||||
-rw-r--r-- | drivers/dahdi/xpp/card_pri.c | 9 | ||||
-rw-r--r-- | drivers/dahdi/xpp/xbus-pcm.c | 2 | ||||
-rw-r--r-- | drivers/dahdi/xpp/xpp_dahdi.c | 3 |
4 files changed, 9 insertions, 11 deletions
diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c index 7d3e652..b390bf7 100644 --- a/drivers/dahdi/xpp/card_bri.c +++ b/drivers/dahdi/xpp/card_bri.c @@ -1171,7 +1171,7 @@ static int BRI_card_close(xpd_t *xpd, lineno_t pos) */ static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); const char *framingstr = ""; const char *codingstr = ""; const char *crcstr = ""; @@ -1227,7 +1227,7 @@ static int bri_chanconfig(struct dahdi_chan *chan, int sigtype) */ static int bri_startup(struct dahdi_span *span) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); struct BRI_priv_data *priv; struct dahdi_chan *dchan; @@ -1263,7 +1263,7 @@ static int bri_startup(struct dahdi_span *span) */ static int bri_shutdown(struct dahdi_span *span) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); struct BRI_priv_data *priv; BUG_ON(!xpd); diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c index c869fd8..53cd8d5 100644 --- a/drivers/dahdi/xpp/card_pri.c +++ b/drivers/dahdi/xpp/card_pri.c @@ -1093,7 +1093,7 @@ bad_lineconfig: static int pri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); struct PRI_priv_data *priv; int ret; @@ -1127,10 +1127,9 @@ static int pri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) */ static int pri_chanconfig(struct dahdi_chan *chan, int sigtype) { - xpd_t *xpd; + xpd_t *xpd = container_of(chan->span, struct xpd, span); struct PRI_priv_data *priv; - xpd = chan->span->pvt; BUG_ON(!xpd); priv = xpd->priv; DBG(GENERAL, "channel %d (%s) -> %s\n", chan->channo, chan->name, sig2str(sigtype)); @@ -1510,7 +1509,7 @@ static int PRI_card_close(xpd_t *xpd, lineno_t pos) */ static int pri_startup(struct dahdi_span *span) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); struct PRI_priv_data *priv; BUG_ON(!xpd); @@ -1533,7 +1532,7 @@ static int pri_startup(struct dahdi_span *span) */ static int pri_shutdown(struct dahdi_span *span) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); struct PRI_priv_data *priv; BUG_ON(!xpd); diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c index ce5c0fa..39b772b 100644 --- a/drivers/dahdi/xpp/xbus-pcm.c +++ b/drivers/dahdi/xpp/xbus-pcm.c @@ -496,7 +496,7 @@ static void global_tick(void) #ifdef DAHDI_SYNC_TICK int dahdi_sync_tick(struct dahdi_span *span, int is_master) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); static int redundant_ticks; /* for extra spans */ struct timeval now; diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c index 72b514e..ebabdcc 100644 --- a/drivers/dahdi/xpp/xpp_dahdi.c +++ b/drivers/dahdi/xpp/xpp_dahdi.c @@ -974,7 +974,7 @@ int xpp_setchunksize(struct dahdi_span *span, int chunksize); /* Enable maintenance modes */ int xpp_maint(struct dahdi_span *span, int cmd) { - xpd_t *xpd = span->pvt; + xpd_t *xpd = container_of(span, struct xpd, span); int ret = 0; #if 0 char loopback_data[] = "THE-QUICK-BROWN-FOX-JUMPED-OVER-THE-LAZY-DOG"; @@ -1096,7 +1096,6 @@ int dahdi_register_xpd(xpd_t *xpd) snprintf(span->name, MAX_SPANNAME, "%s/%s", xbus->busname, xpd->xpdname); span->deflaw = DAHDI_LAW_MULAW; /* default, may be overriden by card_* drivers */ init_waitqueue_head(&span->maintq); - span->pvt = xpd; span->channels = cn; span->chans = xpd->chans; |