Compare commits
1 Commits
v2.9.1-rc1
...
v2.9.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6593097586 |
@@ -953,10 +953,14 @@ int xbus_register_dahdi_device(xbus_t *xbus)
|
||||
goto err;
|
||||
}
|
||||
if (xbus_is_registered(xbus)) {
|
||||
XBUS_ERR(xbus, "Already registered to DAHDI\n");
|
||||
WARN_ON(1);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
/*
|
||||
* Ignore duplicate registrations (from dahdi_registration)
|
||||
* Until we completely migrate to dahdi_autoreg=1 and
|
||||
* hotplug-based span-assignments
|
||||
*/
|
||||
XBUS_DBG(DEVICES, xbus, "Already registered to DAHDI\n");
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
xbus->ddev = dahdi_create_device();
|
||||
if (!xbus->ddev) {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#ifdef PROTOCOL_DEBUG
|
||||
#include <linux/ctype.h>
|
||||
@@ -596,8 +595,6 @@ static DEVICE_ATTR_READER(span_show, dev, buf)
|
||||
return len;
|
||||
}
|
||||
|
||||
static DEFINE_MUTEX(span_store_mutex);
|
||||
|
||||
/*
|
||||
* For backward compatibility with old dahdi-tools
|
||||
* Remove after dahdi_registration is upgraded
|
||||
@@ -619,29 +616,10 @@ static DEVICE_ATTR_WRITER(span_store, dev, buf, count)
|
||||
return -ENODEV;
|
||||
XPD_DBG(DEVICES, xpd, "%s -- deprecated (should use assigned-spans)\n",
|
||||
(dahdi_reg) ? "register" : "unregister");
|
||||
ret = mutex_lock_interruptible(&span_store_mutex);
|
||||
if (ret < 0) {
|
||||
XBUS_ERR(xpd->xbus, "span_store_mutex already taken\n");
|
||||
return ret;
|
||||
}
|
||||
if (xbus_is_registered(xpd->xbus)) {
|
||||
if (dahdi_reg) {
|
||||
XPD_DBG(DEVICES, xpd,
|
||||
"already registered %s. Ignored.\n",
|
||||
xpd->xbus->busname);
|
||||
} else {
|
||||
xbus_unregister_dahdi_device(xpd->xbus);
|
||||
}
|
||||
} else {
|
||||
if (!dahdi_reg) {
|
||||
XPD_DBG(DEVICES, xpd,
|
||||
"already unregistered %s. Ignored.\n",
|
||||
xpd->xbus->busname);
|
||||
} else {
|
||||
xbus_register_dahdi_device(xpd->xbus);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&span_store_mutex);
|
||||
if (dahdi_reg)
|
||||
xbus_register_dahdi_device(xpd->xbus);
|
||||
else
|
||||
xbus_unregister_dahdi_device(xpd->xbus);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user