diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-10-26 18:58:14 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-10-26 18:58:14 +0000 |
commit | 003582d221276735233c1155d5d64e3ee7eec4ac (patch) | |
tree | 66494feaba4f8cec822069d61c1ff46f136764ca /drivers/dahdi/xpp/xbus-sysfs.c | |
parent | 2ee9529e22a0c0ba57f01afebe86cdf2e6c72566 (diff) |
dahdi: Register devices instead of individual spans.
Increasingly, spans are implemented by devices that support more than a
single span. Introduce a 'struct dahdi_device' object which explicitly
contains multiple spans. This will allow a cleaner representation of
spans and devices in sysfs since order of arrival will not determine the
layout of the devices. This also gives the core of dahdi a way to know
the relationship between spans.
This generalizes similar concepts that were previously xpp specific. The
conversion of the xpp code was almost entirely done by Oron and Tzafrir.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10273 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xbus-sysfs.c')
-rw-r--r-- | drivers/dahdi/xpp/xbus-sysfs.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c index daf16fc..c9f78f9 100644 --- a/drivers/dahdi/xpp/xbus-sysfs.c +++ b/drivers/dahdi/xpp/xbus-sysfs.c @@ -623,29 +623,6 @@ static DEVICE_ATTR_READER(span_show, dev, buf) return len; } -static DEVICE_ATTR_WRITER(span_store, dev, buf, count) -{ - xpd_t *xpd; - int dahdi_reg; - int ret; - - BUG_ON(!dev); - xpd = dev_to_xpd(dev); - if(!xpd) - return -ENODEV; - ret = sscanf(buf, "%d", &dahdi_reg); - if(ret != 1) - return -EINVAL; - if(!XBUS_IS(xpd->xbus, READY)) - return -ENODEV; - XPD_DBG(GENERAL, xpd, "%s\n", (dahdi_reg) ? "register" : "unregister"); - if(dahdi_reg) - ret = dahdi_register_xpd(xpd); - else - ret = dahdi_unregister_xpd(xpd); - return (ret < 0) ? ret : count; -} - static DEVICE_ATTR_READER(type_show, dev, buf) { xpd_t *xpd; @@ -728,7 +705,7 @@ static int xpd_match(struct device *dev, struct device_driver *driver) static struct device_attribute xpd_dev_attrs[] = { __ATTR(chipregs, S_IRUGO | S_IWUSR, chipregs_show, chipregs_store), __ATTR(blink, S_IRUGO | S_IWUSR, blink_show, blink_store), - __ATTR(span, S_IRUGO | S_IWUSR, span_show, span_store), + __ATTR_RO(span), __ATTR_RO(type), __ATTR_RO(offhook), __ATTR_RO(timing_priority), |