From 8ba4541654ab8a4dadfba3b416c01eb78e16c8bd Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 12 Sep 2010 12:26:23 +0200 Subject: ap400: move span callbacs to a separate structure r8985 and r8986 moved most of the span operation callbacks from the dahdi_span itself to a separate struct. That struct is allocated statically by the driver. --- drivers/dahdi/ap400/ap400_drv.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/dahdi/ap400/ap400_drv.c b/drivers/dahdi/ap400/ap400_drv.c index ba0f6b4..b8608fa 100644 --- a/drivers/dahdi/ap400/ap400_drv.c +++ b/drivers/dahdi/ap400/ap400_drv.c @@ -1024,6 +1024,22 @@ static int ap4_close(struct dahdi_chan *chan) return 0; } +static const struct dahdi_span_ops ap4_span_ops = { + .owner = THIS_MODULE, + .spanconfig = ap4_spanconfig, + .chanconfig = ap4_chanconfig, + .startup = ap4_startup, + .shutdown = ap4_shutdown, + .rbsbits = ap4_rbsbits, + .maint = ap4_maint, + .open = ap4_open, + .close = ap4_close, +#ifdef APEC_SUPPORT + .echocan = ap4_echocan, +#endif + .ioctl = ap4_ioctl +}; + static void init_spans(struct ap4 *wc) { int x,y,c; @@ -1037,14 +1053,7 @@ static void init_spans(struct ap4 *wc) "PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1); ts->span.manufacturer = "Aligera"; dahdi_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype)); - ts->span.spanconfig = ap4_spanconfig; - ts->span.chanconfig = ap4_chanconfig; - ts->span.startup = ap4_startup; - ts->span.shutdown = ap4_shutdown; - ts->span.rbsbits = ap4_rbsbits; - ts->span.maint = ap4_maint; - ts->span.open = ap4_open; - ts->span.close = ap4_close; + ts->span.ops = &ap4_span_ops; if (ts->spantype == TYPE_E1) { ts->span.channels = 31; ts->span.spantype = "E1"; @@ -1058,10 +1067,6 @@ static void init_spans(struct ap4 *wc) } ts->span.chans = ts->chans; ts->span.flags = DAHDI_FLAG_RBS; - ts->span.ioctl = ap4_ioctl; -#ifdef APEC_SUPPORT - ts->span.echocan = ap4_echocan; -#endif ts->owner = wc; ts->span.offset = x; ts->writechunk = (void *)(wc->writechunk + x * 32 * 2); -- cgit v1.2.3