]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
uas: Allow uas_use_uas_driver to return usb-storage flags
authorHans de Goede <hdegoede@redhat.com>
Tue, 21 Apr 2015 09:20:30 +0000 (11:20 +0200)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 12 May 2015 08:36:37 +0000 (09:36 +0100)
commit a5011d44f0e1117a6db14b19b57c51f8be5673a0 upstream.

uas_use_uas_driver may set some US_FL_foo flags during detection, currently
these are stored in a local variable and then throw away, but these may be
of interest to the caller, so add an extra parameter to (optionally) return
the detected flags, and use this in the uas driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/usb/storage/uas-detect.h
drivers/usb/storage/uas.c
drivers/usb/storage/usb.c

index 9893d696fc973e9e4183b57b56b3ceb22570942f..63ae1619fdb857f8be55968bb258270a4ece50df 100644 (file)
@@ -51,7 +51,8 @@ static int uas_find_endpoints(struct usb_host_interface *alt,
 }
 
 static int uas_use_uas_driver(struct usb_interface *intf,
-                             const struct usb_device_id *id)
+                             const struct usb_device_id *id,
+                             unsigned long *flags_ret)
 {
        struct usb_host_endpoint *eps[4] = { };
        struct usb_device *udev = interface_to_usbdev(intf);
@@ -132,5 +133,8 @@ static int uas_use_uas_driver(struct usb_interface *intf,
                return 0;
        }
 
+       if (flags_ret)
+               *flags_ret = flags;
+
        return 1;
 }
index 27136935fec36c8741bf328f2d341eea50734067..90057ac8601ec9e9ea9619a1d2d7668336578b07 100644 (file)
@@ -1071,8 +1071,9 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
        struct Scsi_Host *shost = NULL;
        struct uas_dev_info *devinfo;
        struct usb_device *udev = interface_to_usbdev(intf);
+       unsigned long dev_flags;
 
-       if (!uas_use_uas_driver(intf, id))
+       if (!uas_use_uas_driver(intf, id, &dev_flags))
                return -ENODEV;
 
        if (uas_switch_interface(udev, intf))
@@ -1095,8 +1096,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
        devinfo->resetting = 0;
        devinfo->running_task = 0;
        devinfo->shutdown = 0;
-       devinfo->flags = id->driver_info;
-       usb_stor_adjust_quirks(udev, &devinfo->flags);
+       devinfo->flags = dev_flags;
        init_usb_anchor(&devinfo->cmd_urbs);
        init_usb_anchor(&devinfo->sense_urbs);
        init_usb_anchor(&devinfo->data_urbs);
index 20c5bcc6d3df17efaeacb933dabce4f2d036f1a4..d3f9708cdcd4e3479fb588a29413bcd1e993234a 100644 (file)
@@ -1052,7 +1052,7 @@ static int storage_probe(struct usb_interface *intf,
 
        /* If uas is enabled and this device can do uas then ignore it. */
 #if IS_ENABLED(CONFIG_USB_UAS)
-       if (uas_use_uas_driver(intf, id))
+       if (uas_use_uas_driver(intf, id, NULL))
                return -ENXIO;
 #endif