speedtch usbatm.c,1.8,1.9

Duncan Sands duncan at infradead.org
Mon Feb 7 11:49:46 EST 2005


Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv15393

Modified Files:
	usbatm.c 
Log Message:
Add more debugging output.


Index: usbatm.c
===================================================================
RCS file: /home/cvs/speedtch/usbatm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- usbatm.c	7 Feb 2005 16:25:07 -0000	1.8
+++ usbatm.c	7 Feb 2005 16:49:42 -0000	1.9
@@ -747,6 +747,8 @@
 {
 	struct usbatm_data *instance = container_of(kref, struct usbatm_data, refcount);
 
+	dbg("usbatm_destroy_instance");
+
 	tasklet_kill(&instance->receive_tasklet);
 	tasklet_kill(&instance->send_tasklet);
 	usb_put_dev(instance->usb_dev);
@@ -755,11 +757,15 @@
 
 void usbatm_get_instance(struct usbatm_data *instance)
 {
+	dbg("usbatm_get_instance");
+
 	kref_get(&instance->refcount);
 }
 
 void usbatm_put_instance(struct usbatm_data *instance)
 {
+	dbg("usbatm_put_instance");
+
 	kref_put(&instance->refcount, usbatm_destroy_instance);
 }
 
@@ -772,6 +778,8 @@
 {
 	struct usbatm_data *instance = dev->dev_data;
 
+	dbg("usbatm_atm_dev_close");
+
 	if (!instance)
 		return;
 
@@ -1157,14 +1165,20 @@
 
  bind:
 	need_heavy = 1;
-	if (driver->bind && (error = driver->bind(instance, intf, &need_heavy)) < 0)
+	if (driver->bind && (error = driver->bind(instance, intf, &need_heavy)) < 0) {
+			dev_dbg(&intf->dev, "bind failed: %d!\n", error);
 			goto fail;
+	}
 
-	if (need_heavy && driver->heavy_init)
+	if (need_heavy && driver->heavy_init) {
 		error = usbatm_heavy_init(instance);
-	else {
+		if (error < 0)
+			dev_dbg(&intf->dev, "failed to start heavy init: %d!\n", error);
+	} else {
 		complete(&instance->thread_exited);	/* pretend that heavy_init was run */
 		error = usbatm_atm_init(instance);
+		if (error < 0)
+			dev_dbg(&intf->dev, "atm_init failed: %d!\n", error);
 	}
 
 	if (error) {
@@ -1179,6 +1193,8 @@
 	return 0;
 
  fail:
+	dev_dbg(&intf->dev, "failed %d!\n", error);
+
 	for (i = 0; i < num_snd_bufs; i++)
 		kfree(instance->send_buffers[i].base);
 




More information about the Usbatm-commits mailing list