[svn-commits] tzafrir: branch linux/2.2 r7491 - in /linux/branches/2.2: ./ drivers/dahdi/xpp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Nov 5 03:10:42 CST 2009


Author: tzafrir
Date: Thu Nov  5 03:10:38 2009
New Revision: 7491

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7491
Log:
xpp: Add sysfs xpd attribute 'timing_priority'

Merged revisions 7237 via svnmerge from 
http://svn.digium.com/svn/dahdi/linux/trunk

Modified:
    linux/branches/2.2/   (props changed)
    linux/branches/2.2/drivers/dahdi/xpp/xbus-sysfs.c

Propchange: linux/branches/2.2/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: linux/branches/2.2/drivers/dahdi/xpp/xbus-sysfs.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.2/drivers/dahdi/xpp/xbus-sysfs.c?view=diff&rev=7491&r1=7490&r2=7491
==============================================================================
--- linux/branches/2.2/drivers/dahdi/xpp/xbus-sysfs.c (original)
+++ linux/branches/2.2/drivers/dahdi/xpp/xbus-sysfs.c Thu Nov  5 03:10:38 2009
@@ -118,7 +118,7 @@
 	do_gettimeofday(&now);
 	xbus = dev_to_xbus(dev);
 	driftinfo = &xbus->drift;
-	len += snprintf(buf + len, PAGE_SIZE - len, "DRIFT: %-3s", sync_mode_name(xbus->sync_mode));
+	len += snprintf(buf + len, PAGE_SIZE - len, "%-3s", sync_mode_name(xbus->sync_mode));
 	if(xbus->sync_mode == SYNC_MODE_PLL) {
 		len += snprintf(buf + len, PAGE_SIZE - len,
 				" %5d: jitter %4d median %4d calc_drift %3d lost (%4d,%4d) : ",
@@ -636,6 +636,22 @@
 	return len;
 }
 
+static DEVICE_ATTR_READER(timing_priority_show, dev, buf)
+{
+	xpd_t			*xpd;
+	unsigned long		flags;
+	int			len = 0;
+
+	BUG_ON(!dev);
+	xpd = dev_to_xpd(dev);
+	if(!xpd)
+		return -ENODEV;
+	spin_lock_irqsave(&xpd->lock, flags);
+	len += sprintf(buf + len, "%d\n", xpd->timing_priority);
+	spin_unlock_irqrestore(&xpd->lock, flags);
+	return len;
+}
+
 static int xpd_match(struct device *dev, struct device_driver *driver)
 {
 	struct xpd_driver	*xpd_driver;
@@ -659,6 +675,7 @@
 	__ATTR(span,		S_IRUGO | S_IWUSR, span_show, span_store),
         __ATTR_RO(type),
         __ATTR_RO(offhook),
+        __ATTR_RO(timing_priority),
         __ATTR_NULL,
 };
 




More information about the svn-commits mailing list