From 6c8bc5060f29f556ff2a00cb2a2a7dc3beb135ee Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 8 Sep 2010 14:04:03 +0300 Subject: 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 typically allocated statically by the driver. --- drivers/dahdi/zaphfc/base.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'drivers/dahdi/zaphfc/base.c') diff --git a/drivers/dahdi/zaphfc/base.c b/drivers/dahdi/zaphfc/base.c index 4db6736..0996b51 100644 --- a/drivers/dahdi/zaphfc/base.c +++ b/drivers/dahdi/zaphfc/base.c @@ -643,6 +643,20 @@ static int hfc_zap_spanconfig(struct dahdi_span *span, return 0; } +static const struct dahdi_span_ops hfc_zap_span_ops = { + .owner = THIS_MODULE, + .chanconfig = hfc_zap_chanconfig, + .spanconfig = hfc_zap_spanconfig, + .startup = hfc_zap_startup, + .shutdown = hfc_zap_shutdown, + .maint = hfc_zap_maint, + .rbsbits = hfc_zap_rbsbits, + .open = hfc_zap_open, + .close = hfc_zap_close, + .ioctl = hfc_zap_ioctl, + .hdlc_hard_xmit = hfc_hdlc_hard_xmit +}; + static int hfc_zap_initialize(struct dahdi_hfc *hfccard) { struct hfc_card *hfctmp = hfccard->card; @@ -656,18 +670,8 @@ static int hfc_zap_initialize(struct dahdi_hfc *hfccard) hfctmp->nt_mode ? "NT" : "TE"); hfccard->span.spantype = hfctmp->nt_mode ? "NT" : "TE"; hfccard->span.manufacturer = "Cologne Chips"; - hfccard->span.spanconfig = hfc_zap_spanconfig; - hfccard->span.owner = THIS_MODULE; - hfccard->span.chanconfig = hfc_zap_chanconfig; - hfccard->span.startup = hfc_zap_startup; - hfccard->span.shutdown = hfc_zap_shutdown; - hfccard->span.maint = hfc_zap_maint; - hfccard->span.rbsbits = hfc_zap_rbsbits; - hfccard->span.open = hfc_zap_open; - hfccard->span.close = hfc_zap_close; - hfccard->span.ioctl = hfc_zap_ioctl; - hfccard->span.hdlc_hard_xmit = hfc_hdlc_hard_xmit; hfccard->span.flags = 0; + hfccard->span.ops = &hfc_zap_span_ops; hfccard->span.irq = hfctmp->pcidev->irq; dahdi_copy_string(hfccard->span.devicetype, "HFC-S PCI-A ISDN", sizeof(hfccard->span.devicetype)); -- cgit v1.2.3