[svn-commits] tzafrir: branch linux/tzafrir/sysfs r7653 - /linux/team/tzafrir/sysfs/drivers...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 30 14:28:24 CST 2009


Author: tzafrir
Date: Mon Nov 30 14:28:23 2009
New Revision: 7653

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7653
Log:
get rid of useless toplevel_bus_type

* Remove the empty toplevel_bus_type.
* Events are sent from the dahdi_span class (and are now actually sent).
* The dummy top-level driver is still there. Renamed to dahdi_top.

Modified:
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c

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=7653&r1=7652&r2=7653
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c Mon Nov 30 14:28:23 2009
@@ -136,15 +136,6 @@
 };
 
 
-/* We have just one handler, and thus we match all spans that register
- * to our bus */
-static int span_match(struct device *dev, struct device_driver *driver)
-{
-	dahdi_dbg(DEVICES, "SYSFS MATCH: dev->bus_id = %s, driver->name = %s\n",
-		dev_name(dev), driver->name);
-	return 1;
-}
-
 #ifdef OLD_HOTPLUG_SUPPORT
 static int span_hotplug(struct device *dev, char **envp, int envnum,
 		char *buff, int bufsize)
@@ -291,17 +282,6 @@
 
 static struct class *span_class;
 
-static struct bus_type toplevel_bus_type = {
-	.name           = "spans",
-	.match          = span_match,
-#ifdef OLD_HOTPLUG_SUPPORT
-	.hotplug 	= span_hotplug,
-#else
-	.uevent         = span_uevent,
-#endif
-	.dev_attrs	= span_dev_attrs,
-};
-
 static struct device toplevel_device = {
 	.release	= dahdi_release
 };
@@ -433,14 +413,13 @@
 			__func__, res);
 		goto failed_class_create;
 	}
+#ifdef OLD_HOTPLUG_SUPPORT
+	span_class->hotplug = span_hotplug;
+#else
+	span_class->dev_uevent = span_uevent;
+#endif
 	span_class->dev_attrs = span_dev_attrs;
-	res = bus_register(&toplevel_bus_type);
-	if (res < 0) {
-		dahdi_err("%s: bus_register(%s) failed. Error number %d",
-			__func__, toplevel_bus_type.name, res);
-		goto failed_bus;
-	}
-	dev_set_name(&toplevel_device, "dahdi");
+	dev_set_name(&toplevel_device, "dahdi_top");
 	res = device_register(&toplevel_device);
 	if (res < 0) {
 		dahdi_err("%s: device_register(%s) failed. Error number %d",
@@ -454,8 +433,6 @@
 failed_chan_bus:
 	device_unregister(&toplevel_device);
 failed_busdevice:
-	bus_unregister(&toplevel_bus_type);
-failed_bus:
 	class_destroy(span_class);
 failed_class_create:
 	return res;
@@ -468,6 +445,5 @@
 	dahdi_driver_chan_exit();
 	device_unregister(&toplevel_device);
 	class_unregister(span_class);
-	bus_unregister(&toplevel_bus_type);
 }
 EXPORT_SYMBOL(dahdi_driver_exit);




More information about the svn-commits mailing list