[PATCH v4 06/14] usb: core: Move struct usb_port and related APIs to port.h

Bartosz Golaszewski brgl at kernel.org
Thu Jul 9 07:30:36 PDT 2026


On Thu, 9 Jul 2026 11:57:11 +0200, Chen-Yu Tsai <wenst at chromium.org> said:
> |struct usb_port| and its matching container_of() macro should live in
> its own port.h, matching the split we have for .c files.
>
> Move them as described. Also move usb_port_is_power_on(), since in the
> next change its |struct usb_hub *| parameter will be changed to
> |struct usb_port *|, and becomes a non-static function that only
> references |struct usb_port|.
>
> port.h is only included from hub.h, as a subsequent patch will directly
> use fields from |struct usb_port| in a static inline helper in hub.h.
> The USB internal headers don't have header guards to help with this.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Signed-off-by: Chen-Yu Tsai <wenst at chromium.org>
> ---

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski at oss.qualcomm.com>



More information about the Linux-mediatek mailing list