]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - drivers/usb/core/hcd.c
Merge tag 'usb-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[thirdparty/linux.git] / drivers / usb / core / hcd.c
index edf74458474a1e7065d3d6c3bd651e9cbba172b8..c0e005670d67d1b9cf0b8cdb03d12635148772d6 100644 (file)
@@ -357,12 +357,10 @@ static const u8 ss_rh_config_descriptor[] = {
 #define USB_AUTHORIZE_ALL      1
 #define USB_AUTHORIZE_INTERNAL 2
 
-static int authorized_default = USB_AUTHORIZE_WIRED;
+static int authorized_default = CONFIG_USB_DEFAULT_AUTHORIZATION_MODE;
 module_param(authorized_default, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(authorized_default,
-               "Default USB device authorization: 0 is not authorized, 1 is "
-               "authorized, 2 is authorized for internal devices, -1 is "
-               "authorized (default, same as 1)");
+               "Default USB device authorization: 0 is not authorized, 1 is authorized (default), 2 is authorized for internal devices, -1 is authorized (same as 1)");
 /*-------------------------------------------------------------------------*/
 
 /**
@@ -2795,10 +2793,16 @@ int usb_add_hcd(struct usb_hcd *hcd,
        struct usb_device *rhdev;
        struct usb_hcd *shared_hcd;
 
-       if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
-               hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
-               if (IS_ERR(hcd->phy_roothub))
-                       return PTR_ERR(hcd->phy_roothub);
+       if (!hcd->skip_phy_initialization) {
+               if (usb_hcd_is_primary_hcd(hcd)) {
+                       hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
+                       if (IS_ERR(hcd->phy_roothub))
+                               return PTR_ERR(hcd->phy_roothub);
+               } else {
+                       hcd->phy_roothub = usb_phy_roothub_alloc_usb3_phy(hcd->self.sysdev);
+                       if (IS_ERR(hcd->phy_roothub))
+                               return PTR_ERR(hcd->phy_roothub);
+               }
 
                retval = usb_phy_roothub_init(hcd->phy_roothub);
                if (retval)