media: flexcop-usb: use usb_endpoint_maxp()
authorJohan Hovold <johan@kernel.org>
Mon, 22 Aug 2022 15:14:56 +0000 (17:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Sep 2022 08:59:25 +0000 (10:59 +0200)
Use the usb_endpoint_maxp() helper instead of open coding.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20220822151456.27178-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/b2c2/flexcop-usb.c

index 7102b34..790787f 100644 (file)
@@ -430,7 +430,7 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
        int bufsize, i, j, ret;
        int buffer_offset = 0;
 
-       frame_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
+       frame_size = usb_endpoint_maxp(&alt->endpoint[0].desc);
        bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * frame_size;
 
        deb_ts("creating %d iso-urbs with %d frames each of %d bytes size = %d.\n",