[dahdi-commits] tzafrir: branch linux/tzafrir/sysfs r7345 - /linux/team/tzafrir/sysfs/drivers...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Tue Oct 6 16:35:32 CDT 2009


Author: tzafrir
Date: Tue Oct  6 16:35:20 2009
New Revision: 7345

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7345
Log:
update build with 2.6.31

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

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs-chan.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs-chan.c?view=diff&rev=7345&r1=7344&r2=7345
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs-chan.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs-chan.c Tue Oct  6 16:35:20 2009
@@ -155,9 +155,8 @@
 	dev = &chan->chan_device;
 	dev->bus = &dahdi_chan_type;
 	dev->parent = &span->span_device;
-	snprintf(dev->bus_id, BUS_ID_SIZE, "%03d:%02d",
-		span->spanno, chan->chanpos);
-	dev->driver_data = chan;
+	dev_set_name(dev, "%03d:%02d", span->spanno, chan->chanpos);
+	dev_set_drvdata(dev, chan);
 	dev->release = chan_release;
 	res = device_register(dev);
 	if(res) {
@@ -175,11 +174,11 @@
 
 	CHAN_DBG(DEVICES, chan, "SYSFS\n");
 	dev = &chan->chan_device;
-	if(!dev->driver_data)
+	if(!dev_get_drvdata(dev))
 		return;
-	BUG_ON(dev->driver_data != chan);
+	BUG_ON(dev_get_drvdata(dev) != chan);
 	device_unregister(dev);
-	dev->driver_data = NULL;
+	dev_set_drvdata(dev, NULL);
 }
 
 /*--------- Sysfs Device handling ----*/

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=7345&r1=7344&r2=7345
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c Tue Oct  6 16:35:20 2009
@@ -297,7 +297,7 @@
 static int span_match(struct device *dev, struct device_driver *driver)
 {
 	DBG(DEVICES, "SYSFS MATCH: dev->bus_id = %s, driver->name = %s\n",
-		dev->bus_id, driver->name);
+		dev_name(dev), driver->name);
 	return 1;
 }
 
@@ -343,7 +343,7 @@
 	if(!dev)
 		return -ENODEV;
 	span = dev_to_span(dev);
-	DBG(GENERAL, "SYFS bus_id=%s span=%s\n", dev->bus_id, span->name);
+	DBG(GENERAL, "SYFS dev_name=%s span=%s\n", dev_name(dev), span->name);
 	SPAN_VAR_BLOCK;
 	envp[i] = NULL;
 	return 0;
@@ -364,7 +364,7 @@
 	if(!dev)
 		return -ENODEV;
 	span = dev_to_span(dev);
-	DBG(GENERAL, "SYFS bus_id=%s span=%s\n", dev->bus_id, span->name);
+	DBG(GENERAL, "SYFS dev_name=%s span=%s\n", dev_name(dev), span->name);
 	SPAN_VAR_BLOCK;
 	return 0;
 }
@@ -408,8 +408,8 @@
 	struct kobject	*kobj;
 
 	kobj = &span->span_device.kobj;
-	SPAN_DBG(DEVICES, span, "SYFS bus_id=%s action=%d\n",
-		span->span_device.bus_id, act);
+	SPAN_DBG(DEVICES, span, "SYFS dev_name=%s action=%d\n",
+		dev_name(&span->span_device), act);
 
 #if defined(OLD_HOTPLUG_SUPPORT_269)
 	{
@@ -434,7 +434,7 @@
 
 static void dahdi_release(struct device *dev)
 {
-	DBG(DEVICES, "SYSFS %s\n", dev->bus_id);
+	DBG(DEVICES, "SYSFS %s\n", dev_name(dev));
 }
 
 static void span_release(struct device *dev)
@@ -464,7 +464,7 @@
 };
 
 static struct device toplevel_device = {
-	.bus_id		= "dahdi",
+	//.bus_id		= "dahdi",
 	.release	= dahdi_release
 };
 
@@ -554,9 +554,9 @@
 		chan_device_unregister(chan);
 	}
 	unreg_custom_span_attr(span);
-	if(!span_device->driver_data)
+	if(!dev_get_drvdata(span_device))
 		return;
-	BUG_ON(span_device->driver_data != span);
+	BUG_ON(dev_get_drvdata(span_device) != span);
 	span_uevent_send(span, KOBJ_OFFLINE);
 	device_unregister(&span->span_device);
 }
@@ -574,13 +574,13 @@
 	SPAN_DBG(DEVICES, span, "\n");
 	span_device->bus = &toplevel_bus_type;
 	span_device->parent = &toplevel_device;
-	snprintf(span_device->bus_id, BUS_ID_SIZE, "span-%03d", span->spanno);
-	span_device->driver_data = span;
+	dev_set_name(span_device, "span-%03d", span->spanno);
+	dev_set_drvdata(span_device, span);
 	span_device->release = span_release;
 	res = device_register(span_device);
 	if(res) {
 		SPAN_ERR(span, "%s: device_register failed: %d\n", __func__, res);
-		span_device->driver_data = NULL;
+		dev_set_drvdata(span_device, NULL);
 		return res;
 	}
 	res = reg_custom_span_attr(span);
@@ -601,7 +601,7 @@
 	return res;
 
 err_span_attr:
-	if (span_device && span_device->driver_data)
+	if (span_device && dev_get_drvdata(span_device))
 		device_unregister(span_device);
 	return res;
 }
@@ -617,9 +617,10 @@
 			__func__, toplevel_bus_type.name, res);
 		goto failed_bus;
 	}
+	dev_set_name(&toplevel_device, "dahdi");
 	if((res = device_register(&toplevel_device)) < 0) {
 		ERR("%s: device_register(%s) failed. Error number %d",
-			__func__, toplevel_device.bus_id, res);
+			__func__, dev_name(&toplevel_device), res);
 		goto failed_busdevice;
 	}
 	if((res = driver_register(&span_driver)) < 0) {




More information about the dahdi-commits mailing list