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

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


Author: tzafrir
Date: Wed Dec  2 14:21:42 2009
New Revision: 7659

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7659
Log:
Allow drivers to provide a proper location in the device tree

Add a new parent_device pointer. Should optionally be set before span
registration time.

If a span driver has already created a device node for the device that
holds the span, it should set the span_device pointer. If it is NULL, the
dummy dahdi_top one will be used.

Modified:
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c
    linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.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=7659&r1=7658&r2=7659
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c Wed Dec  2 14:21:42 2009
@@ -320,7 +320,10 @@
 	span_dbg(DEVICES, span, "\n");
 
 	span_device->class = span_class;
-	span_device->parent = &toplevel_device;
+	if (span->parent_device)
+		span_device->parent = span->parent_device;
+	else
+		span_device->parent = &toplevel_device;
 	dev_set_name(span_device, "span-%03d", span->spanno);
 	dev_set_drvdata(span_device, span);
 	span_device->release = span_release;

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c?view=diff&rev=7659&r1=7658&r2=7659
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c Wed Dec  2 14:21:42 2009
@@ -1093,6 +1093,7 @@
 		span->hooksig = xpp_hooksig;	/* Only with RBS bits */
 	span->ioctl = xpp_ioctl;
 	span->maint = xpp_maint;
+	span->parent_device = &xpd->xpd_dev;
 	/*
 	 * This actually describe the dahdi_spaninfo version 3
 	 * A bunch of unrelated data exported via a modified ioctl()

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=7659&r1=7658&r2=7659
==============================================================================
--- linux/team/tzafrir/sysfs/include/dahdi/kernel.h (original)
+++ linux/team/tzafrir/sysfs/include/dahdi/kernel.h Wed Dec  2 14:21:42 2009
@@ -844,6 +844,10 @@
 
 	/* Used by DAHDI only -- no user servicable parts inside */
 	struct device span_device; /*!< Kernel object for this span (TODO: rename) */
+	/* FIXME: placing the span in the device tree should be done by the
+	 * low-level driver, right? 
+	 */
+	struct device *parent_device; /*!< Location in the devices tree */
 #define dev_to_span(dev)  container_of(dev, struct dahdi_span, span_device)
 	int spanno;			/*!< Span number for DAHDI */
 	int offset;			/*!< Offset within a given card */




More information about the svn-commits mailing list