diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-07-26 00:30:39 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-07-26 00:30:39 +0000 |
commit | 8682c2a90bd996765326fb6477a2466b63530b73 (patch) | |
tree | 384ce57c53c650294c490cda43b5ea7e624685cc /drivers/dahdi/wctdm24xxp/base.c | |
parent | 5c45b4da59502f5a30f3eb01e431d92d3d1c2202 (diff) |
dahdi: Remove the 'pvt' member from dahdi_span.
The vast majority of board drivers already keep the dahdi_span structure
in a driver specific structure. The others were easily converted. This
way board drivers can use the container_of macro to find what was
previously pointed to by the "pvt" member of the span. One less thing
to think about in the span structure.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8984 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/base.c')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 92b5b50..99236fa 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -3312,9 +3312,15 @@ static int wctdm_open(struct dahdi_chan *chan) return 0; } +static inline struct wctdm *span_to_wctdm(struct dahdi_span *span) +{ + struct wctdm_span *s = container_of(span, struct wctdm_span, span); + return s->wc; +} + static int wctdm_watchdog(struct dahdi_span *span, int event) { - struct wctdm *wc = span->pvt; + struct wctdm *wc = span_to_wctdm(span); dev_info(&wc->vb.pdev->dev, "TDM: Called watchdog\n"); return 0; } @@ -3609,6 +3615,7 @@ static struct wctdm_span *wctdm_init_span(struct wctdm *wc, int spanno, int chan s->span.offset = spanno; s->spanno = spancount++; + s->wc = wc; /* Do not change the procfs representation for non-hx8 cards. */ if (digital_span) @@ -4787,7 +4794,6 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) return -EIO; } b4 = wc->mods[i].bri; - b400m_set_dahdi_span(b4, i & 0x03, &wc->spans[curspan]->span); ++curspan; curchan += 3; @@ -4822,7 +4828,6 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) wctdm_init_span(wc, curspan, curchan, wc->desc->ports, 0); wctdm_fixup_analog_span(wc, curspan); wc->aspan = wc->spans[curspan]; - wc->aspan->span.pvt = wc; curchan += wc->desc->ports; ++curspan; } |