[PATCH v4 06/14] usb: core: Move struct usb_port and related APIs to port.h
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Thu Jul 9 03:36:37 PDT 2026
On Thu, Jul 09, 2026 at 05:57:11PM +0800, Chen-Yu Tsai wrote:
> |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.
Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
...
> +extern int usb_port_is_power_on(struct usb_hub *hub, unsigned int portstatus);
Drop 'extern', it's not needed in a modern code (like 20 years?).
--
With Best Regards,
Andy Shevchenko
More information about the Linux-mediatek
mailing list