Commit 880bca3a authored by Bjørn Mork's avatar Bjørn Mork Committed by Greg Kroah-Hartman

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: default avatarBjørn Mork <bjorn@mork.no>
Acked-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 007bab91
...@@ -620,10 +620,12 @@ static int wdm_release(struct inode *inode, struct file *file) ...@@ -620,10 +620,12 @@ static int wdm_release(struct inode *inode, struct file *file)
if (!desc->count) { if (!desc->count) {
dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); dev_dbg(&desc->intf->dev, "wdm_release: cleanup");
kill_urbs(desc); kill_urbs(desc);
if (!test_bit(WDM_DISCONNECTING, &desc->flags)) if (!test_bit(WDM_DISCONNECTING, &desc->flags)) {
desc->manage_power(desc->intf, 0); desc->manage_power(desc->intf, 0);
else } else {
dev_dbg(&desc->intf->dev, "%s: device gone - cleaning up\n", __func__);
cleanup(desc); cleanup(desc);
}
} }
mutex_unlock(&wdm_mutex); mutex_unlock(&wdm_mutex);
return 0; return 0;
...@@ -897,6 +899,8 @@ static void wdm_disconnect(struct usb_interface *intf) ...@@ -897,6 +899,8 @@ static void wdm_disconnect(struct usb_interface *intf)
mutex_unlock(&desc->rlock); mutex_unlock(&desc->rlock);
if (!desc->count) if (!desc->count)
cleanup(desc); cleanup(desc);
else
dev_dbg(&intf->dev, "%s: %d open files - postponing cleanup\n", __func__, desc->count);
mutex_unlock(&wdm_mutex); mutex_unlock(&wdm_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment