Current code does not check endpoint 15 interrupt. Use number
of endpoint configured in hardware instead of the hardcoded value.

Signed-off-by: Mian Yousaf Kaukab <[email protected]>
---
 drivers/usb/dwc2/gadget.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index c5df746..ebc73ed 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2341,12 +2341,14 @@ irq_retry:
 
                dev_dbg(hsotg->dev, "%s: daint=%08x\n", __func__, daint);
 
-               for (ep = 0; ep < 15 && daint_out; ep++, daint_out >>= 1) {
+               for (ep = 0; ep < hsotg->num_of_eps && daint_out;
+                                               ep++, daint_out >>= 1) {
                        if (daint_out & 1)
                                s3c_hsotg_epint(hsotg, ep, 0);
                }
 
-               for (ep = 0; ep < 15 && daint_in; ep++, daint_in >>= 1) {
+               for (ep = 0; ep < hsotg->num_of_eps  && daint_in;
+                                               ep++, daint_in >>= 1) {
                        if (daint_in & 1)
                                s3c_hsotg_epint(hsotg, ep, 1);
                }
-- 
1.9.1

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Knarrarnasgatan 15, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

Reply via email to