tiocmget: kill off the passing of the struct file
[firefly-linux-kernel-4.4.55.git] / drivers / usb / serial / usb-serial.c
index 861223f2af6eddc0a3fb3c4a449b71af9221eed4..df105c6531a17283139d64282476e4a57f2417db 100644 (file)
@@ -51,6 +51,7 @@ static struct usb_driver usb_serial_driver = {
        .suspend =      usb_serial_suspend,
        .resume =       usb_serial_resume,
        .no_dynamic_id =        1,
+       .supports_autosuspend = 1,
 };
 
 /* There is no MODULE_DEVICE_TABLE for usbserial.c.  Instead
@@ -495,14 +496,14 @@ static const struct file_operations serial_proc_fops = {
        .release        = single_release,
 };
 
-static int serial_tiocmget(struct tty_struct *tty, struct file *file)
+static int serial_tiocmget(struct tty_struct *tty)
 {
        struct usb_serial_port *port = tty->driver_data;
 
        dbg("%s - port %d", __func__, port->number);
 
        if (port->serial->type->tiocmget)
-               return port->serial->type->tiocmget(tty, file);
+               return port->serial->type->tiocmget(tty);
        return -EINVAL;
 }
 
@@ -1346,6 +1347,12 @@ int usb_serial_register(struct usb_serial_driver *driver)
 
        if (!driver->description)
                driver->description = driver->driver.name;
+       if (!driver->usb_driver) {
+               WARN(1, "Serial driver %s has no usb_driver\n",
+                               driver->description);
+               return -EINVAL;
+       }
+       driver->usb_driver->supports_autosuspend = 1;
 
        /* Add this device to our list of devices */
        mutex_lock(&table_lock);