[svn-commits] tzafrir: branch linux/tzafrir/sysfs r7657 - in /linux/team/tzafrir/sysfs: dri...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 2 12:45:04 CST 2009


Author: tzafrir
Date: Wed Dec  2 12:45:00 2009
New Revision: 7657

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7657
Log:
Remove driver-specific span attributes.

Driver-specific span attributes should probably be added in a node set up
by that driver. At least until we see a case where they are needed.

Modified:
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c
    linux/team/tzafrir/sysfs/drivers/dahdi/wcfxo.c
    linux/team/tzafrir/sysfs/include/dahdi/kernel.h

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c?view=diff&rev=7657&r1=7656&r2=7657
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c Wed Dec  2 12:45:00 2009
@@ -287,51 +287,6 @@
 };
 
 
-/*--------- Sysfs Device handling ----*/
-
-/* Register the dev_attrs of the span in sysfs as extra attributes
-   to the device
-
-   FIXME: Both this and the following function use internal fields
-   of struct device_attribute (.attr.name).
-*/
-static int reg_custom_span_attr(struct dahdi_span *span)
-{
-	struct device		*device = &span->span_device;
-	struct device_attribute *dev_attrs = span->dev_attrs;
-	int			res = 0;
-	int			i;
-
-	if (!dev_attrs)
-		return 0;
-
-	for (i = 0; dev_attrs[i].attr.name != NULL; i++) {
-		res = device_create_file(device, &dev_attrs[i]);
-		if (res) {
-			span_err(span, "Failed registering attribute %s: %d\n",
-					dev_attrs[i].attr.name, res);
-			for (i--; i >= 0; i--)
-				device_remove_file(device, &dev_attrs[i]);
-			return res;
-		}
-	}
-
-	return res;
-}
-
-static void unreg_custom_span_attr(struct dahdi_span *span)
-{
-	struct device		*device = &span->span_device;
-	struct device_attribute *dev_attrs = span->dev_attrs;
-	int			i;
-
-	if (!dev_attrs)
-		return;
-
-	for (i = 0; dev_attrs[i].attr.name != NULL; i++)
-		device_remove_file(device, &dev_attrs[i]);
-}
-
 void span_sysfs_remove(struct dahdi_span *span)
 {
 	struct device	*span_device;
@@ -345,7 +300,6 @@
 		struct dahdi_chan *chan = span->chans[x];
 		chan_device_unregister(chan);
 	}
-	unreg_custom_span_attr(span);
 	if (!dev_get_drvdata(span_device))
 		return;
 	BUG_ON(dev_get_drvdata(span_device) != span);
@@ -377,7 +331,6 @@
 		dev_set_drvdata(span_device, NULL);
 		return res;
 	}
-	res = reg_custom_span_attr(span);
 	if (res)
 		goto err_span_attr;
 

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/wcfxo.c?view=diff&rev=7657&r1=7656&r2=7657
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/wcfxo.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/wcfxo.c Wed Dec  2 12:45:00 2009
@@ -272,6 +272,7 @@
 fxo_pvt_attr(offhook, "%d\n");
 fxo_pvt_attr(battery, "%d\n");
 
+/* FIXME: currently unused. Keep it at attributes for a future device/driver */
 static struct device_attribute span_dev_attrs[] = {
         __ATTR_RO(battery),
         __ATTR_RO(offhook),
@@ -693,7 +694,6 @@
 	wc->span.flags = DAHDI_FLAG_RBS;
 	wc->span.deflaw = DAHDI_LAW_MULAW;
 	wc->span.watchdog = wcfxo_watchdog;
-	wc->span.dev_attrs = span_dev_attrs;
 #ifdef ENABLE_TASKLETS
 	tasklet_init(&wc->wcfxo_tlet, wcfxo_tasklet, (unsigned long)wc);
 #endif

Modified: linux/team/tzafrir/sysfs/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/include/dahdi/kernel.h?view=diff&rev=7657&r1=7656&r2=7657
==============================================================================
--- linux/team/tzafrir/sysfs/include/dahdi/kernel.h (original)
+++ linux/team/tzafrir/sysfs/include/dahdi/kernel.h Wed Dec  2 12:45:00 2009
@@ -794,8 +794,6 @@
 	/*! Opt: Enable maintenance modes */
 	int (*maint)(struct dahdi_span *span, int mode);
 
-	/*! Opt: NULL-terminated Array of custom sysfs device attributes */
-	struct device_attribute * dev_attrs;
 #ifdef	DAHDI_SYNC_TICK
 	/*! Opt: send sync to spans */
 	int (*sync_tick)(struct dahdi_span *span, int is_master);




More information about the svn-commits mailing list