Re: [RFC 08/15] usb: Refactor irq enabling out of usb_add_hcd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Nov 2010, Sarah Sharp wrote:

> Refactor out the code in usb_add_hcd() to request the IRQ line for the
> HCD.  This will only need to be called once for the two xHCI roothubs, so
> it's easier to refactor it into a function, rather than wrapping the long
> if-else block into another if statement.
> 
> Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/hcd.c |   71 +++++++++++++++++++++++++++--------------------
>  1 files changed, 41 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 02ce408..fda5a11 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2197,6 +2197,44 @@ void usb_put_hcd (struct usb_hcd *hcd)
>  }
>  EXPORT_SYMBOL_GPL(usb_put_hcd);
>  
> +static int usb_hcd_request_irqs(struct usb_hcd *hcd,
> +		unsigned int irqnum, unsigned long irqflags)
> +{
> +	int retval;
> +
> +	if (hcd->driver->irq) {

A simpler approach might be to add a test for irqnum < NR_IRQS in
usb_add_hcd(), and pass a large value for irqnum when registering the
SuperSpeed hcd.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux