diff options
| author | Bjørn Mork <bjorn@mork.no> | 2012-04-30 03:26:11 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-30 09:57:27 -0400 |
| commit | 880bca3a2a6f159d7453e0cbcbfe2f1d8204d907 (patch) | |
| tree | cccf91abc20d432962cbefd6cecfb176aedc81c1 /drivers/usb/class | |
| parent | 007bab91324e6337bb150ffc17b20cf829686370 (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>
Diffstat (limited to 'drivers/usb/class')
| -rw-r--r-- | drivers/usb/class/cdc-wdm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 650e1da4d2bf..4e8451ca2d6c 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
| @@ -620,10 +620,12 @@ static int wdm_release(struct inode *inode, struct file *file) | |||
| 620 | if (!desc->count) { | 620 | if (!desc->count) { |
| 621 | dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); | 621 | dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); |
| 622 | kill_urbs(desc); | 622 | kill_urbs(desc); |
| 623 | if (!test_bit(WDM_DISCONNECTING, &desc->flags)) | 623 | if (!test_bit(WDM_DISCONNECTING, &desc->flags)) { |
| 624 | desc->manage_power(desc->intf, 0); | 624 | desc->manage_power(desc->intf, 0); |
| 625 | else | 625 | } else { |
| 626 | dev_dbg(&desc->intf->dev, "%s: device gone - cleaning up\n", __func__); | ||
| 626 | cleanup(desc); | 627 | cleanup(desc); |
| 628 | } | ||
| 627 | } | 629 | } |
| 628 | mutex_unlock(&wdm_mutex); | 630 | mutex_unlock(&wdm_mutex); |
| 629 | return 0; | 631 | return 0; |
| @@ -897,6 +899,8 @@ static void wdm_disconnect(struct usb_interface *intf) | |||
| 897 | mutex_unlock(&desc->rlock); | 899 | mutex_unlock(&desc->rlock); |
| 898 | if (!desc->count) | 900 | if (!desc->count) |
| 899 | cleanup(desc); | 901 | cleanup(desc); |
| 902 | else | ||
| 903 | dev_dbg(&intf->dev, "%s: %d open files - postponing cleanup\n", __func__, desc->count); | ||
| 900 | mutex_unlock(&wdm_mutex); | 904 | mutex_unlock(&wdm_mutex); |
| 901 | } | 905 | } |
| 902 | 906 | ||
