summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOron Peled <oron.peled@xorcom.com>2011-05-23 18:17:30 +0300
committerOron Peled <oron.peled@xorcom.com>2011-05-23 18:17:30 +0300
commit72779010659e968f3b400f4ef513f375eb022df2 (patch)
tree52cd2df4d869d51a5d49d9a2993696762972e6cc
parent15654c14c8a566edeb07b25aeb73ce2578dad2f2 (diff)
add the "location" attribute to dahdi_device sysfs representation
-rw-r--r--drivers/dahdi/dahdi-sysfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c
index 26fa4a8..161a1d9 100644
--- a/drivers/dahdi/dahdi-sysfs.c
+++ b/drivers/dahdi/dahdi-sysfs.c
@@ -475,6 +475,15 @@ dahdi_device_span_count_show(struct device *dev,
}
static ssize_t
+dahdi_device_location_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct dahdi_device *ddev = to_ddev(dev);
+
+ return sprintf(buf, "%s\n", ddev->location);
+}
+
+static ssize_t
dahdi_device_auto_register(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
@@ -514,6 +523,7 @@ static struct device_attribute dahdi_device_attrs[] = {
__ATTR(manufacturer, S_IRUGO, dahdi_device_manufacturer_show, NULL),
__ATTR(type, S_IRUGO, dahdi_device_type_show, NULL),
__ATTR(span_count, S_IRUGO, dahdi_device_span_count_show, NULL),
+ __ATTR(location, S_IRUGO, dahdi_device_location_show, NULL),
__ATTR(auto_register, S_IWUSR, NULL, dahdi_device_auto_register),
__ATTR(register_span, S_IWUSR, NULL, dahdi_device_register_span),
__ATTR_NULL,