Re: [RFC PATCH 2/5] usb: core: hcd: Let usb_add_hcd() indicate if roothub has to be registered

From: Alan Stern
Date: Tue Aug 24 2021 - 10:56:20 EST


On Tue, Aug 24, 2021 at 04:22:59PM +0530, Kishon Vijay Abraham I wrote:
> No functional change. Add __usb_add_hcd() which takes "register_hub"
> flag that indicates if roothub has to be registered or not. This is in
> preparation for allowing xhci to register roothub after the shared hcd
> is created. The interface for usb_add_hcd() is not modified to make sure
> there is no USB subsystem wide changes.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx>
> ---
> drivers/usb/core/hcd.c | 20 +++++++++++---------
> include/linux/usb/hcd.h | 8 ++++++--
> 2 files changed, 17 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index c036ba5311b3..4d7a9f0e2caa 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2788,13 +2788,14 @@ static void usb_stop_hcd(struct usb_hcd *hcd)
> * @hcd: the usb_hcd structure to initialize
> * @irqnum: Interrupt line to allocate
> * @irqflags: Interrupt type flags
> + * @register_hub: Flag to indicate if roothub has to be registered.
> *
> * Finish the remaining parts of generic HCD initialization: allocate the
> * buffers of consistent memory, register the bus, request the IRQ line,
> * and call the driver's reset() and start() routines.
> */
> -int usb_add_hcd(struct usb_hcd *hcd,
> - unsigned int irqnum, unsigned long irqflags)
> +int __usb_add_hcd(struct usb_hcd *hcd, unsigned int irqnum, unsigned long irqflags,
> + bool register_hub)

For future reference: When you change the name of a function, be
sure to update the name in the kerneldoc comment as well.

Alan Stern