aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2012-04-30 09:26:11 +0200
committerBjørn Mork <bjorn@mork.no>2012-06-04 21:58:13 +0200
commit2a8b6ee5cd04420ea4a980e87d932055cc3c7c18 (patch)
treef0060e6ee175ca1848b6cf4057c1d9f2d414b357
parent0be7fa4bbc63ddea52976fcef09b8a3e196ca462 (diff)
USB: cdc-wdm: add debug messages on cleanup
Device state cleanup is done in either wdm_disconnect or wdm_release depending on the order they are called. Adding a couple of debug messages to document the program flow. Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 880bca3a2a6f159d7453e0cbcbfe2f1d8204d907) Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--drivers/usb/class/cdc-wdm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 6ec73d8cc22..32a2017ef47 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -623,10 +623,12 @@ static int wdm_release(struct inode *inode, struct file *file)
if (!desc->count) {
dev_dbg(&desc->intf->dev, "wdm_release: cleanup");
kill_urbs(desc);
- if (!test_bit(WDM_DISCONNECTING, &desc->flags))
+ if (!test_bit(WDM_DISCONNECTING, &desc->flags)) {
desc->manage_power(desc->intf, 0);
- else
+ } else {
+ dev_dbg(&desc->intf->dev, "%s: device gone - cleaning up\n", __func__);
cleanup(desc);
+ }
}
mutex_unlock(&wdm_mutex);
return 0;
@@ -900,6 +902,8 @@ static void wdm_disconnect(struct usb_interface *intf)
mutex_unlock(&desc->rlock);
if (!desc->count)
cleanup(desc);
+ else
+ dev_dbg(&intf->dev, "%s: %d open files - postponing cleanup\n", __func__, desc->count);
mutex_unlock(&wdm_mutex);
}