* [PATCH] usb: core: Minor improvements to usb_hub_create_port_device
@ 2023-10-17 16:43 Heiner Kallweit
2023-10-17 16:59 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2023-10-17 16:43 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Linux USB Mailing List
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: core: Minor improvements to usb_hub_create_port_device
2023-10-17 16:43 [PATCH] usb: core: Minor improvements to usb_hub_create_port_device Heiner Kallweit
@ 2023-10-17 16:59 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-10-17 16:59 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Linux USB Mailing List
On Tue, Oct 17, 2023 at 06:43:51PM +0200, Heiner Kallweit wrote:
> 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
Please do not do multiple things in the same patch. These need to be
all broken up into "one patch per logical change" to be able to properly
review and potentially revert them in the future.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-17 16:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 16:43 [PATCH] usb: core: Minor improvements to usb_hub_create_port_device Heiner Kallweit
2023-10-17 16:59 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox