diff options
author | Tao Ren <rentao.bupt@gmail.com> | 2020-05-28 04:11:54 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-10-02 09:43:36 +0300 |
commit | a1c0169a49fc537629cc63da50d2ce0e3b48281c (patch) | |
tree | c68df8192f23b3c57b78aeb1bcdac4bec78b8d91 /drivers/usb/gadget/udc/aspeed-vhub/core.c | |
parent | e319bd62292cb9c40ce5396b416965c2517f70d1 (diff) | |
download | linux-a1c0169a49fc537629cc63da50d2ce0e3b48281c.tar.xz |
usb: gadget: aspeed: fixup vhub port irq handling
This is a follow-on patch for commit a23be4ed8f48 ("usb: gadget: aspeed:
improve vhub port irq handling"): for_each_set_bit() is replaced with
simple for() loop because for() loop runs faster on ASPEED BMC.
Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/udc/aspeed-vhub/core.c')
-rw-r--r-- | drivers/usb/gadget/udc/aspeed-vhub/core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c b/drivers/usb/gadget/udc/aspeed-vhub/core.c index cdf96911e4b1..be7bb64e3594 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/core.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c @@ -135,13 +135,9 @@ static irqreturn_t ast_vhub_irq(int irq, void *data) /* Handle device interrupts */ if (istat & vhub->port_irq_mask) { - unsigned long bitmap = istat; - int offset = VHUB_IRQ_DEV1_BIT; - int size = VHUB_IRQ_DEV1_BIT + vhub->max_ports; - - for_each_set_bit_from(offset, &bitmap, size) { - i = offset - VHUB_IRQ_DEV1_BIT; - ast_vhub_dev_irq(&vhub->ports[i].dev); + for (i = 0; i < vhub->max_ports; i++) { + if (istat & VHUB_DEV_IRQ(i)) + ast_vhub_dev_irq(&vhub->ports[i].dev); } } |