[svn-commits] sruffell: linux/trunk r8986 - in /linux/trunk: drivers/dahdi/ drivers/dahdi/w...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sun Jul 25 19:30:52 CDT 2010
Author: sruffell
Date: Sun Jul 25 19:30:43 2010
New Revision: 8986
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8986
Log:
dahdi: Move the 'owner' field from dahdi_span to dahdi_span_ops.
One more thing that can be moved out of the per-span structure.
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
linux/trunk/drivers/dahdi/dahdi_dummy.c
linux/trunk/drivers/dahdi/dahdi_dynamic.c
linux/trunk/drivers/dahdi/pciradio.c
linux/trunk/drivers/dahdi/tor2.c
linux/trunk/drivers/dahdi/wcb4xxp/base.c
linux/trunk/drivers/dahdi/wcfxo.c
linux/trunk/drivers/dahdi/wct1xxp.c
linux/trunk/drivers/dahdi/wct4xxp/base.c
linux/trunk/drivers/dahdi/wctdm.c
linux/trunk/drivers/dahdi/wctdm24xxp/base.c
linux/trunk/drivers/dahdi/wcte11xp.c
linux/trunk/drivers/dahdi/wcte12xp/base.c
linux/trunk/drivers/dahdi/xpp/card_bri.c
linux/trunk/drivers/dahdi/xpp/card_fxo.c
linux/trunk/drivers/dahdi/xpp/card_fxs.c
linux/trunk/drivers/dahdi/xpp/card_pri.c
linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c
linux/trunk/include/dahdi/kernel.h
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Sun Jul 25 19:30:43 2010
@@ -2734,7 +2734,7 @@
if (chan->flags & DAHDI_FLAG_PSEUDO)
chan->flags |= DAHDI_FLAG_AUDIO;
if (chan->span) {
- if (!try_module_get(chan->span->owner))
+ if (!try_module_get(chan->span->ops->owner))
res = -ENXIO;
else if (chan->span->ops->open)
res = chan->span->ops->open(chan);
@@ -2771,7 +2771,7 @@
if (chan->span) {
if (chan->span->ops->close)
res = chan->span->ops->close(chan);
- module_put(chan->span->owner);
+ module_put(chan->span->ops->owner);
}
/* The channel might be destroyed by low-level driver span->close() */
if (chans[unit])
@@ -5877,7 +5877,12 @@
if (!span)
return -EINVAL;
- WARN_ON(!span->owner);
+ if (!span->ops)
+ return -EINVAL;
+
+ if (!span->ops->owner)
+ return -EINVAL;
+
if (test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags)) {
module_printk(KERN_ERR, "Span %s already appears to be registered\n", span->name);
Modified: linux/trunk/drivers/dahdi/dahdi_dummy.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dummy.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dummy.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dummy.c Sun Jul 25 19:30:43 2010
@@ -199,6 +199,10 @@
}
#endif
+static const struct dahdi_span_ops dummy_ops = {
+ .owner = THIS_MODULE,
+};
+
static int dahdi_dummy_initialize(struct dahdi_dummy *ztd)
{
/* DAHDI stuff */
@@ -208,12 +212,12 @@
sprintf(ztd->chan->name, "DAHDI_DUMMY/%d/%d", 1, 0);
dahdi_copy_string(ztd->span.devicetype, "DAHDI Dummy Timing", sizeof(ztd->span.devicetype));
ztd->chan->chanpos = 1;
- ztd->span.owner = THIS_MODULE;
ztd->span.chans = &ztd->chan;
ztd->span.channels = 0; /* no channels on our span */
ztd->span.deflaw = DAHDI_LAW_MULAW;
init_waitqueue_head(&ztd->span.maintq);
ztd->chan->pvt = ztd;
+ ztd->span.ops = &dummy_ops;
if (dahdi_register(&ztd->span, 0)) {
return -1;
}
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic.c Sun Jul 25 19:30:43 2010
@@ -528,6 +528,7 @@
}
static const struct dahdi_span_ops dynamic_ops = {
+ .owner = THIS_MODULE,
.rbsbits = ztd_rbsbits,
.open = ztd_open,
.close = ztd_close,
@@ -592,7 +593,6 @@
z->timing = zds->timing;
sprintf(z->span.name, "DYN/%s/%s", zds->driver, zds->addr);
sprintf(z->span.desc, "Dynamic '%s' span at '%s'", zds->driver, zds->addr);
- z->span.owner = THIS_MODULE;
z->span.channels = zds->numchans;
z->span.deflaw = DAHDI_LAW_MULAW;
z->span.flags |= DAHDI_FLAG_RBS;
Modified: linux/trunk/drivers/dahdi/pciradio.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/pciradio.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/pciradio.c (original)
+++ linux/trunk/drivers/dahdi/pciradio.c Sun Jul 25 19:30:43 2010
@@ -1459,6 +1459,7 @@
}
static const struct dahdi_span_ops pciradio_span_ops = {
+ .owner = THIS_MODULE,
.hooksig = pciradio_hooksig,
.open = pciradio_open,
.close = pciradio_close,
@@ -1471,7 +1472,6 @@
int x;
/* DAHDI stuff */
- rad->span.owner = THIS_MODULE;
sprintf(rad->span.name, "PCIRADIO/%d", rad->pos);
sprintf(rad->span.desc, "Board %d", rad->pos + 1);
rad->span.deflaw = DAHDI_LAW_MULAW;
Modified: linux/trunk/drivers/dahdi/tor2.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/tor2.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/tor2.c (original)
+++ linux/trunk/drivers/dahdi/tor2.c Sun Jul 25 19:30:43 2010
@@ -260,6 +260,7 @@
}
static const struct dahdi_span_ops tor2_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = tor2_spanconfig,
.chanconfig = tor2_chanconfig,
.startup = tor2_startup,
@@ -285,7 +286,6 @@
dahdi_copy_string(s->devicetype, tor->type, sizeof(s->devicetype));
snprintf(s->location, sizeof(s->location) - 1,
"PCI Bus %02d Slot %02d", tor->pci->bus->number, PCI_SLOT(tor->pci->devfn) + 1);
- s->owner = THIS_MODULE;
if (tor->cardtype == TYPE_T1) {
s->channels = 24;
s->deflaw = DAHDI_LAW_MULAW;
Modified: linux/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcb4xxp/base.c Sun Jul 25 19:30:43 2010
@@ -2313,6 +2313,7 @@
/* internal functions, not specific to the hardware or DAHDI */
static const struct dahdi_span_ops b4xxp_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = b4xxp_spanconfig,
.chanconfig = b4xxp_chanconfig,
.startup = b4xxp_startup,
@@ -2360,7 +2361,6 @@
sprintf(bspan->span.location, "PCI Bus %02d Slot %02d",
b4->pdev->bus->number, PCI_SLOT(b4->pdev->devfn) + 1);
- bspan->span.owner = THIS_MODULE;
bspan->span.ops = &b4xxp_span_ops;
/* HDLC stuff */
bspan->sigchan = NULL;
Modified: linux/trunk/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcfxo.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wcfxo.c (original)
+++ linux/trunk/drivers/dahdi/wcfxo.c Sun Jul 25 19:30:43 2010
@@ -639,6 +639,7 @@
}
static const struct dahdi_span_ops wcfxo_span_ops = {
+ .owner = THIS_MODULE,
.hooksig = wcfxo_hooksig,
.open = wcfxo_open,
.close = wcfxo_close,
@@ -648,7 +649,6 @@
static int wcfxo_initialize(struct wcfxo *wc)
{
/* DAHDI stuff */
- wc->span.owner = THIS_MODULE;
sprintf(wc->span.name, "WCFXO/%d", wc->pos);
snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Board %d", wc->variety, wc->pos + 1);
sprintf(wc->chan->name, "WCFXO/%d/%d", wc->pos, 0);
Modified: linux/trunk/drivers/dahdi/wct1xxp.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct1xxp.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wct1xxp.c (original)
+++ linux/trunk/drivers/dahdi/wct1xxp.c Sun Jul 25 19:30:43 2010
@@ -747,6 +747,7 @@
}
static const struct dahdi_span_ops t1xxp_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = t1xxp_spanconfig,
.chanconfig = t1xxp_chanconfig,
.startup = t1xxp_startup,
@@ -777,7 +778,6 @@
dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
snprintf(wc->span.location, sizeof(wc->span.location) - 1,
"PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
- wc->span.owner = THIS_MODULE;
wc->span.irq = wc->dev->irq;
wc->span.chans = wc->chans;
wc->span.flags = DAHDI_FLAG_RBS;
Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Sun Jul 25 19:30:43 2010
@@ -1847,6 +1847,7 @@
}
static const struct dahdi_span_ops t4_gen1_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = t4_spanconfig,
.chanconfig = t4_chanconfig,
.startup = t4_startup,
@@ -1860,6 +1861,7 @@
};
static const struct dahdi_span_ops t4_gen2_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = t4_spanconfig,
.chanconfig = t4_chanconfig,
.startup = t4_startup,
@@ -1907,7 +1909,6 @@
ts->span.spantype = "J1";
break;
}
- ts->span.owner = THIS_MODULE;
ts->span.irq = wc->dev->irq;
/* HDLC Specific init */
Modified: linux/trunk/drivers/dahdi/wctdm.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm.c (original)
+++ linux/trunk/drivers/dahdi/wctdm.c Sun Jul 25 19:30:43 2010
@@ -2335,6 +2335,7 @@
}
static const struct dahdi_span_ops wctdm_span_ops = {
+ .owner = THIS_MODULE,
.hooksig = wctdm_hooksig,
.open = wctdm_open,
.close = wctdm_close,
@@ -2366,7 +2367,6 @@
wc->chans[x]->chanpos = x+1;
wc->chans[x]->pvt = wc;
}
- wc->span.owner = THIS_MODULE;
wc->span.chans = wc->chans;
wc->span.channels = NUM_CARDS;
wc->span.irq = wc->dev->irq;
Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Sun Jul 25 19:30:43 2010
@@ -3559,6 +3559,7 @@
}
static const struct dahdi_span_ops wctdm24xxp_analog_span_ops = {
+ .owner = THIS_MODULE,
.hooksig = wctdm_hooksig,
.open = wctdm_open,
.close = wctdm_close,
@@ -3571,6 +3572,7 @@
};
static const struct dahdi_span_ops wctdm24xxp_digital_span_ops = {
+ .owner = THIS_MODULE,
.open = wctdm_open,
.close = wctdm_close,
.ioctl = wctdm_ioctl,
@@ -3641,7 +3643,6 @@
return NULL;
/* DAHDI stuff */
- s->span.owner = THIS_MODULE;
s->span.offset = spanno;
s->spanno = spancount++;
Modified: linux/trunk/drivers/dahdi/wcte11xp.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte11xp.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wcte11xp.c (original)
+++ linux/trunk/drivers/dahdi/wcte11xp.c Sun Jul 25 19:30:43 2010
@@ -956,6 +956,7 @@
}
static const struct dahdi_span_ops t1xxp_span_ops = {
+ .owner = THIS_MODULE,
.startup = t1xxp_startup,
.shutdown = t1xxp_shutdown,
.rbsbits = t1xxp_rbsbits,
@@ -981,7 +982,6 @@
return -1;
t4_serial_setup(wc);
wc->num = x;
- wc->span.owner = THIS_MODULE;
sprintf(wc->span.name, "WCT1/%d", wc->num);
snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, wc->num);
wc->span.manufacturer = "Digium";
Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Sun Jul 25 19:30:43 2010
@@ -1507,6 +1507,7 @@
}
static const struct dahdi_span_ops t1_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = t1xxp_spanconfig,
.chanconfig = t1xxp_chanconfig,
.startup = t1xxp_startup,
@@ -1550,7 +1551,6 @@
"PCI Bus %02d Slot %02d", pdev->bus->number,
PCI_SLOT(pdev->devfn) + 1);
- wc->span.owner = THIS_MODULE;
wc->span.irq = pdev->irq;
if (wc->spantype == TYPE_E1) {
Modified: linux/trunk/drivers/dahdi/xpp/card_bri.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_bri.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_bri.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_bri.c Sun Jul 25 19:30:43 2010
@@ -862,6 +862,7 @@
}
static const struct dahdi_span_ops BRI_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = bri_spanconfig,
.chanconfig = bri_chanconfig,
.startup = bri_startup,
@@ -897,7 +898,6 @@
/* Nothing to do yet */
return 0;
}
- xpd->span.owner = THIS_MODULE;
xpd->span.spantype = "BRI";
xpd->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS;
xpd->span.deflaw = DAHDI_LAW_ALAW;
Modified: linux/trunk/drivers/dahdi/xpp/card_fxo.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxo.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxo.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxo.c Sun Jul 25 19:30:43 2010
@@ -511,8 +511,6 @@
BUG_ON(!priv);
timer_count = xpd->timer_count;
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"ON":"OFF");
- xpd->span.owner = THIS_MODULE;
- xpd->span.spantype = "FXO";
for_each_line(xpd, i) {
struct dahdi_chan *cur_chan = XPD_CHAN(xpd, i);
Modified: linux/trunk/drivers/dahdi/xpp/card_fxs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxs.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxs.c Sun Jul 25 19:30:43 2010
@@ -496,7 +496,6 @@
priv = xpd->priv;
BUG_ON(!priv);
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
- xpd->span.owner = THIS_MODULE;
xpd->span.spantype = "FXS";
for_each_line(xpd, i) {
struct dahdi_chan *cur_chan = XPD_CHAN(xpd, i);
Modified: linux/trunk/drivers/dahdi/xpp/card_pri.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_pri.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_pri.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_pri.c Sun Jul 25 19:30:43 2010
@@ -1274,6 +1274,7 @@
#endif
static const struct dahdi_span_ops PRI_span_ops = {
+ .owner = THIS_MODULE,
.spanconfig = pri_spanconfig,
.chanconfig = pri_chanconfig,
.startup = pri_startup,
@@ -1315,7 +1316,6 @@
/* Nothing to do yet */
return 0;
}
- xpd->span.owner = THIS_MODULE;
xpd->span.spantype = pri_protocol_name(priv->pri_protocol);
xpd->span.linecompat = pri_linecompat(priv->pri_protocol);
xpd->span.deflaw = priv->deflaw;
Modified: linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c Sun Jul 25 19:30:43 2010
@@ -1070,6 +1070,7 @@
}
static const struct dahdi_span_ops xpp_span_ops = {
+ .owner = THIS_MODULE,
.open = xpp_open,
.close = xpp_close,
.ioctl = xpp_ioctl,
@@ -1077,6 +1078,7 @@
};
static const struct dahdi_span_ops xpp_rbs_span_ops = {
+ .owner = THIS_MODULE,
.hooksig = xpp_hooksig,
.open = xpp_open,
.close = xpp_close,
@@ -1158,10 +1160,6 @@
xbus->num, xpd->addr.unit, xpd->addr.subunit, xpd->type_name);
XPD_DBG(GENERAL, xpd, "Registering span '%s'\n", xpd->span.desc);
xpd->xops->card_dahdi_preregistration(xpd, 1);
- if(!xpd->span.owner) {
- XPD_ERR(xpd, "NO span.owner field -- bug in low-level driver\n");
- WARN_ON(!xpd->span.owner);
- }
if(dahdi_register(&xpd->span, prefmaster)) {
XPD_ERR(xpd, "Failed to dahdi_register span\n");
return -ENODEV;
Modified: linux/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/kernel.h?view=diff&rev=8986&r1=8985&r2=8986
==============================================================================
--- linux/trunk/include/dahdi/kernel.h (original)
+++ linux/trunk/include/dahdi/kernel.h Sun Jul 25 19:30:43 2010
@@ -751,6 +751,8 @@
#define DAHDI_FLAG_HDLC56 DAHDI_FLAG(HDLC56)
struct dahdi_span_ops {
+ struct module *owner; /*!< Which module is exporting this span. */
+
/* ==== Span Callback Operations ==== */
/*! Req: Set the requested chunk size. This is the unit in which you must
report results for conferencing, etc */
@@ -829,7 +831,6 @@
struct dahdi_span {
spinlock_t lock;
- struct module *owner; /*!< Which module is exporting this span. */
char name[40]; /*!< Span name */
char desc[80]; /*!< Span description */
const char *spantype; /*!< span type in text form */
More information about the svn-commits
mailing list