USB: suspend/resume support for usbtmc
authorOliver Neukum <oliver@neukum.org>
Thu, 2 Jul 2009 09:44:33 +0000 (11:44 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Sep 2009 13:46:28 +0000 (06:46 -0700)
a class driver should have suspend/resume. This makes sure we
don't see a virtual disconnect unnecessarily.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/usbtmc.c

index 0c9df97f677594620379186a0a3ac6c2aafe125d..4f0858fbf980372cf3556aad100c086975ac115e 100644 (file)
@@ -1087,11 +1087,24 @@ static void usbtmc_disconnect(struct usb_interface *intf)
        kref_put(&data->kref, usbtmc_delete);
 }
 
+static int usbtmc_suspend (struct usb_interface *intf, pm_message_t message)
+{
+       /* this driver does not have pending URBs */
+       return 0;
+}
+
+static int usbtmc_resume (struct usb_interface *intf)
+{
+       return 0;
+}
+
 static struct usb_driver usbtmc_driver = {
        .name           = "usbtmc",
        .id_table       = usbtmc_devices,
        .probe          = usbtmc_probe,
-       .disconnect     = usbtmc_disconnect
+       .disconnect     = usbtmc_disconnect,
+       .suspend        = usbtmc_suspend,
+       .resume         = usbtmc_resume,
 };
 
 static int __init usbtmc_init(void)