From 7f23d49bd89101bbd195e9ca9d3d8c28db5895aa Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 12 Sep 2010 12:11:24 +0200 Subject: 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(). --- drivers/dahdi/ap400/ap400_drv.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers/dahdi/ap400/ap400_drv.c') 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"); -- cgit v1.2.3