aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/usb-skeleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/usb-skeleton.c')
-rw-r--r--drivers/usb/usb-skeleton.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 59973aecd968..8de11deb5d14 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -467,12 +467,35 @@ static int skel_resume (struct usb_interface *intf)
467 return 0; 467 return 0;
468} 468}
469 469
470static int skel_pre_reset(struct usb_interface *intf)
471{
472 struct usb_skel *dev = usb_get_intfdata(intf);
473
474 mutex_lock(&dev->io_mutex);
475 skel_draw_down(dev);
476
477 return 0;
478}
479
480static int skel_post_reset(struct usb_interface *intf)
481{
482 struct usb_skel *dev = usb_get_intfdata(intf);
483
484 /* we are sure no URBs are active - no locking needed */
485 dev->errors = -EPIPE;
486 mutex_unlock(&dev->io_mutex);
487
488 return 0;
489}
490
470static struct usb_driver skel_driver = { 491static struct usb_driver skel_driver = {
471 .name = "skeleton", 492 .name = "skeleton",
472 .probe = skel_probe, 493 .probe = skel_probe,
473 .disconnect = skel_disconnect, 494 .disconnect = skel_disconnect,
474 .suspend = skel_suspend, 495 .suspend = skel_suspend,
475 .resume = skel_resume, 496 .resume = skel_resume,
497 .pre_reset = skel_pre_reset,
498 .post_reset = skel_post_reset,
476 .id_table = skel_table, 499 .id_table = skel_table,
477 .supports_autosuspend = 1, 500 .supports_autosuspend = 1,
478}; 501};