diff options
author | Tao Ren <rentao.bupt@gmail.com> | 2020-03-02 22:23:31 -0800 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-03-15 12:11:44 +0200 |
commit | 487bc82801ab056e084d3005185ba39264d40e7c (patch) | |
tree | 9f3f067d6901a34c0dac44c4ed4e0c39e6788a59 /drivers/usb/gadget/udc/aspeed-vhub/epn.c | |
parent | 6dbf05fcb68870546d5059ac95747d21ffbf807d (diff) | |
download | linux-487bc82801ab056e084d3005185ba39264d40e7c.tar.gz linux-487bc82801ab056e084d3005185ba39264d40e7c.tar.bz2 linux-487bc82801ab056e084d3005185ba39264d40e7c.zip |
usb: gadget: aspeed: read vhub properties from device tree
The patch introduces 2 DT properties ("aspeed,vhub-downstream-ports" and
"aspeed,vhub-generic-endpoints") which replaces hardcoded port/endpoint
number. It is to make it more convenient to add support for newer vhub
revisions with different number of ports and endpoints.
Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/udc/aspeed-vhub/epn.c')
-rw-r--r-- | drivers/usb/gadget/udc/aspeed-vhub/epn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/epn.c b/drivers/usb/gadget/udc/aspeed-vhub/epn.c index 7475c74aa5c5..0bd6b20435b8 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/epn.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/epn.c @@ -800,10 +800,10 @@ struct ast_vhub_ep *ast_vhub_alloc_epn(struct ast_vhub_dev *d, u8 addr) /* Find a free one (no device) */ spin_lock_irqsave(&vhub->lock, flags); - for (i = 0; i < AST_VHUB_NUM_GEN_EPs; i++) + for (i = 0; i < vhub->max_epns; i++) if (vhub->epns[i].dev == NULL) break; - if (i >= AST_VHUB_NUM_GEN_EPs) { + if (i >= vhub->max_epns) { spin_unlock_irqrestore(&vhub->lock, flags); return NULL; } |