diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2010-09-12 12:11:24 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2010-09-12 15:26:22 +0200 |
commit | 7f23d49bd89101bbd195e9ca9d3d8c28db5895aa (patch) | |
tree | 045143a1e2e1bcd4636ccafaed1f654d0fc11480 /drivers/dahdi/ap400/ap400_drv.c | |
parent | 7a39bf8983515adaeac5b168103d9298dd448632 (diff) |
ap400: remove 'pvt' member of dahdi_span
r8984 removed the member 'pvt' of struct dahdi_span in dahdi/kernel.h . No
use to have a pointer to a struct that is already embedded in our struct.
Thus we remove a single usage of it and replace it with container_of().
Diffstat (limited to 'drivers/dahdi/ap400/ap400_drv.c')
-rw-r--r-- | drivers/dahdi/ap400/ap400_drv.c | 13 |
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"); |