summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2010-09-12 12:26:23 +0200
committerTzafrir Cohen <tzafrir@cohens.org.il>2010-09-12 15:26:30 +0200
commit8ba4541654ab8a4dadfba3b416c01eb78e16c8bd (patch)
tree6a1d873164d6aea30aca69cc916b495c0295a961
parent7f23d49bd89101bbd195e9ca9d3d8c28db5895aa (diff)
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.
-rw-r--r--drivers/dahdi/ap400/ap400_drv.c29
1 files 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);