From 72779010659e968f3b400f4ef513f375eb022df2 Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Mon, 23 May 2011 18:17:30 +0300 Subject: add the "location" attribute to dahdi_device sysfs representation --- drivers/dahdi/dahdi-sysfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 @@ -474,6 +474,15 @@ dahdi_device_span_count_show(struct device *dev, return sprintf(buf, "%d\n", count); } +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, -- cgit v1.2.3