media: cx231xx: Add EP5_BUF_SIZE and EP5_TIMEOUT_MS macros

Define EP5_BUF_SIZE and EP5_TIMEOUT_MS macros to make the code
more readable.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Jinjie Ruan 2023-09-03 16:14:40 +08:00 committed by Hans Verkuil
parent e85322573d
commit 2b651ba688
2 changed files with 5 additions and 2 deletions

View file

@ -751,12 +751,12 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
int ret = -ENOMEM;
u32 *buffer;
buffer = kmemdup(firmware, 4096, GFP_KERNEL);
buffer = kmemdup(firmware, EP5_BUF_SIZE, GFP_KERNEL);
if (buffer == NULL)
return -ENOMEM;
ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 5),
buffer, 4096, &actlen, 2000);
buffer, EP5_BUF_SIZE, &actlen, EP5_TIMEOUT_MS);
if (ret)
dev_err(dev->dev,

View file

@ -120,6 +120,9 @@
#define CX23417_OSC_EN 8
#define CX23417_RESET 9
#define EP5_BUF_SIZE 4096
#define EP5_TIMEOUT_MS 2000
struct cx23417_fmt {
u32 fourcc; /* v4l2 format id */
int depth;