USB: serial: use generic method if no alternative is provided in usb serial layer
authorOliver Neukum <oliver@neukum.org>
Fri, 6 Feb 2009 17:06:43 +0000 (18:06 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Mar 2009 23:20:30 +0000 (16:20 -0700)
This patch makes use of the generic method if a serial driver provides
no implementation. This simplifies implementing suspend/resume support
in serial drivers.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c

index c6aaa6dc75644dff1fc832b9305deec01b83d24f..18f9408473161ebeac50f56d404bb1b9266c089e 100644 (file)
@@ -1085,12 +1085,15 @@ EXPORT_SYMBOL(usb_serial_suspend);
 int usb_serial_resume(struct usb_interface *intf)
 {
        struct usb_serial *serial = usb_get_intfdata(intf);
+       int rv;
 
        serial->suspending = 0;
        if (serial->type->resume)
-               return serial->type->resume(serial);
+               rv = serial->type->resume(serial);
+       else
+               rv = usb_serial_generic_resume(serial);
 
-       return 0;
+       return rv;
 }
 EXPORT_SYMBOL(usb_serial_resume);