Re: [PATCH v8 08/16] usb: hub: Pass |struct usb_port*| to usb_port_is_power_on()

From: Alan Stern

Date: Fri Sep 04 2026 - 13:47:41 EST


On Fri, Sep 04, 2026 at 04:41:47PM +0800, Chen-Yu Tsai wrote:
> usb_port_is_power_on() currently takes |struct usb_hub*|, but only needs
> it to tell if the hub/port is SuperSpeed or not.
>
> In a subsequent change, usb_port_is_power_on() needs access to a pwrseq
> state tracking field in |struct usb_port|. Either structure can be used
> to identify whether a port/hub is SuperSpeed or not, as the field in
> |struct usb_port| is inherited from the hub:
>
> port->is_superspeed = hub_is_superspeed(hub)
>
> Replace usb_port_is_power_on()'s |struct usb_hub*| parameter with
> |struct usb_port*| so a subsequent change can use it.

Minor complaint (not referring to anything you're doing here):
port->is_superspeed really should have a better name, more like

port->is_superspeed_capable

or

port->is_usb3.

As it stands, the name is ambiguous. It might refer to the speed of
devices that the port could connect to, or it might refer to the speed
of the device the port is currently connected to.

Alan Stern