[svn-commits] tzafrir: linux/trunk r10281 - /linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Oct 26 14:06:14 CDT 2011


Author: tzafrir
Date: Wed Oct 26 14:06:11 2011
New Revision: 10281

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10281
Log:
xpp: adapt to 'location' attribute removal:

 * Reparent astribanks below their USB transport
 * This way their location can be derived from their hardware
   hierarchy.
 * The tradeoff is that once USB hardware is disconnected, there
   is no sysfs visibility of the astribank object even if it
   cannot be release yet due to open channels by asterisk
 * Thus, we'll need to migrate to "surprise removal" of dahdi
   devices...

Signed-off-by: Oron Peled <oron.peled at xorcom.com>

Modified:
    linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c

Modified: linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c?view=diff&rev=10281&r1=10280&r2=10281
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c Wed Oct 26 14:06:11 2011
@@ -437,16 +437,6 @@
 	XBUS_INFO(xbus, "[%s] Astribank Release\n", xbus->label);
 	xbus_free(xbus);
 }
-
-static void toplevel_release(struct device *dev)
-{
-	NOTICE("%s\n", __func__);
-}
-
-static struct device toplevel_device = {
-	.release	= toplevel_release,
-	/* No Parent */
-};
 
 static struct bus_type toplevel_bus_type = {
 	.name           = "astribanks",
@@ -941,7 +931,7 @@
 	astribank = &xbus->astribank;
 	XBUS_DBG(DEVICES, xbus, "\n");
 	astribank->bus = &toplevel_bus_type;
-	astribank->parent = &toplevel_device;
+	astribank->parent = xbus->transport.transport_device;
 	dev_set_name(astribank, "xbus-%02d", xbus->num);
 	dev_set_drvdata(astribank, xbus);
 	astribank->release = astribank_release;
@@ -958,16 +948,10 @@
 	int	ret;
 
 	DBG(DEVICES, "SYSFS\n");
-	dev_set_name(&toplevel_device, "astribanks");
-	ret = device_register(&toplevel_device);
-	if (ret) {
-		ERR("%s: toplevel device_register failed: %d\n", __func__, ret);
-		goto failed_toplevel;
-	}
 	if((ret = bus_register(&toplevel_bus_type)) < 0) {
 		ERR("%s: bus_register(%s) failed. Error number %d",
 			__FUNCTION__, toplevel_bus_type.name, ret);
-		goto failed_bus;
+		goto failed_toplevel;
 	}
 	if((ret = driver_register(&xpp_driver)) < 0) {
 		ERR("%s: driver_register(%s) failed. Error number %d",
@@ -984,8 +968,6 @@
 	driver_unregister(&xpp_driver);
 failed_xpp_driver:
 	bus_unregister(&toplevel_bus_type);
-failed_bus:
-	device_unregister(&toplevel_device);
 failed_toplevel:
 	return ret;
 }
@@ -996,7 +978,6 @@
 	bus_unregister(&xpd_type);
 	driver_unregister(&xpp_driver);
 	bus_unregister(&toplevel_bus_type);
-	device_unregister(&toplevel_device);
 }
 
 EXPORT_SYMBOL(xpd_driver_register);




More information about the svn-commits mailing list