usb: core: hcd: make hcd->irq unsigned
There's really no point in having hcd->irq as a signed integer when we consider the fact that IRQ 0 means NO_IRQ. In order to avoid confusion, make hcd->irq unsigned and fix users who were passing -1 as the IRQ number to usb_add_hcd. Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
444aa7fa9b
commit
cd70469d08
@ -2352,7 +2352,7 @@ static int usb_hcd_request_irqs(struct usb_hcd *hcd,
|
||||
"io mem" : "io base",
|
||||
(unsigned long long)hcd->rsrc_start);
|
||||
} else {
|
||||
hcd->irq = -1;
|
||||
hcd->irq = 0;
|
||||
if (hcd->rsrc_start)
|
||||
dev_info(hcd->self.controller, "%s 0x%08llx\n",
|
||||
(hcd->driver->flags & HCD_MEMORY) ?
|
||||
@ -2508,7 +2508,7 @@ err_register_root_hub:
|
||||
clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
|
||||
del_timer_sync(&hcd->rh_timer);
|
||||
err_hcd_driver_start:
|
||||
if (usb_hcd_is_primary_hcd(hcd) && hcd->irq >= 0)
|
||||
if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0)
|
||||
free_irq(irqnum, hcd);
|
||||
err_request_irq:
|
||||
err_hcd_driver_setup:
|
||||
@ -2573,7 +2573,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
|
||||
del_timer_sync(&hcd->rh_timer);
|
||||
|
||||
if (usb_hcd_is_primary_hcd(hcd)) {
|
||||
if (hcd->irq >= 0)
|
||||
if (hcd->irq > 0)
|
||||
free_irq(hcd->irq, hcd);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user