diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2023-10-17 23:11:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-21 12:53:55 +0200 |
commit | c9a1d9e74a43ae8f2d1718243c1de277dc0e7027 (patch) | |
tree | 98ca09ec2e85bed8b11b1e496664785b9a3744c2 /drivers/usb | |
parent | usb: typec: tcpm: Add additional checks for contaminant (diff) | |
download | linux-c9a1d9e74a43ae8f2d1718243c1de277dc0e7027.tar.xz linux-c9a1d9e74a43ae8f2d1718243c1de277dc0e7027.zip |
usb: core: Remove duplicated check in usb_hub_create_port_device
Simplify the code by not calling hub_is_superspeed() twice.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/b1d77cbc-faa3-4d07-94ff-f6ffb85c6964@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/port.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 149bedb8e64f..c628c1abc907 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -713,6 +713,7 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1) set_bit(port1, hub->power_bits); port_dev->dev.parent = hub->intfdev; if (hub_is_superspeed(hdev)) { + port_dev->is_superspeed = 1; port_dev->usb3_lpm_u1_permit = 1; port_dev->usb3_lpm_u2_permit = 1; port_dev->dev.groups = port_dev_usb3_group; @@ -720,8 +721,6 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1) port_dev->dev.groups = port_dev_group; port_dev->dev.type = &usb_port_device_type; port_dev->dev.driver = &usb_port_driver; - if (hub_is_superspeed(hub->hdev)) - port_dev->is_superspeed = 1; dev_set_name(&port_dev->dev, "%s-port%d", dev_name(&hub->hdev->dev), port1); mutex_init(&port_dev->status_lock); |