Skip to content

Commit

Permalink
USB: cdc-wdm: add debug messages on cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bjørn Mork authored and Greg Kroah-Hartman committed Apr 30, 2012
1 parent 007bab9 commit 880bca3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,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;
Expand Down Expand Up @@ -897,6 +899,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);
}

Expand Down

0 comments on commit 880bca3

Please sign in to comment.