From: Heiner Kallweit <hkallweit1@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linux USB Mailing List <linux-usb@vger.kernel.org>
Subject: [PATCH] usb: core: Minor improvements to usb_hub_create_port_device
Date: Tue, 17 Oct 2023 18:43:51 +0200 [thread overview]
Message-ID: <4793f68e-cb16-4058-9704-230ae0e32b8e@gmail.com> (raw)
Minor improvements, no functional change intended.
- Use variable hdev instead of hub->hdev
- Don't call hub_is_superspeed() twice
- Style fix for else clause
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/usb/core/port.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index 77be0dc28..84bd83d99 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -698,17 +698,16 @@ 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;
- } else
+ } else {
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);
+ dev_set_name(&port_dev->dev, "%s-port%d", dev_name(&hdev->dev), port1);
mutex_init(&port_dev->status_lock);
retval = device_register(&port_dev->dev);
if (retval) {
--
2.42.0
next reply other threads:[~2023-10-17 16:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 16:43 Heiner Kallweit [this message]
2023-10-17 16:59 ` [PATCH] usb: core: Minor improvements to usb_hub_create_port_device Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4793f68e-cb16-4058-9704-230ae0e32b8e@gmail.com \
--to=hkallweit1@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox