Commit 091cb2f7 authored by Kelly Devilliv's avatar Kelly Devilliv Committed by Greg Kroah-Hartman

usb: host: fotg210: fix the actual_length of an iso packet

We should acquire the actual_length of an iso packet
from the iTD directly using FOTG210_ITD_LENGTH() macro.
Signed-off-by: default avatarKelly Devilliv <kelly.devilliv@gmail.com>
Link: https://lore.kernel.org/r/20210627125747.127646-4-kelly.devilliv@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2e89876
......@@ -4463,13 +4463,12 @@ static bool itd_complete(struct fotg210_hcd *fotg210, struct fotg210_itd *itd)
/* HC need not update length with this error */
if (!(t & FOTG210_ISOC_BABBLE)) {
desc->actual_length =
fotg210_itdlen(urb, desc, t);
desc->actual_length = FOTG210_ITD_LENGTH(t);
urb->actual_length += desc->actual_length;
}
} else if (likely((t & FOTG210_ISOC_ACTIVE) == 0)) {
desc->status = 0;
desc->actual_length = fotg210_itdlen(urb, desc, t);
desc->actual_length = FOTG210_ITD_LENGTH(t);
urb->actual_length += desc->actual_length;
} else {
/* URB was too late */
......
......@@ -683,11 +683,6 @@ static inline unsigned fotg210_read_frame_index(struct fotg210_hcd *fotg210)
return fotg210_readl(fotg210, &fotg210->regs->frame_index);
}
#define fotg210_itdlen(urb, desc, t) ({ \
usb_pipein((urb)->pipe) ? \
(desc)->length - FOTG210_ITD_LENGTH(t) : \
FOTG210_ITD_LENGTH(t); \
})
/*-------------------------------------------------------------------------*/
#endif /* __LINUX_FOTG210_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment