* [02/27] media: cpia2_usb: use usb_fill_int_urb()
@ 2018-06-20 11:00 Sebastian Andrzej Siewior
0 siblings, 0 replies; only message in thread
From: Sebastian Andrzej Siewior @ 2018-06-20 11:00 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, linux-usb, tglx, Sebastian Andrzej Siewior
Using usb_fill_int_urb() helps to find code which initializes an
URB. A grep for members of the struct (like ->complete) reveal lots
of other things, too.
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/media/usb/cpia2/cpia2_usb.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c
index a771e0a52610..6f94bdcc4111 100644
--- a/drivers/media/usb/cpia2/cpia2_usb.c
+++ b/drivers/media/usb/cpia2/cpia2_usb.c
@@ -689,16 +689,11 @@ static int submit_urbs(struct camera_data *cam)
}
cam->sbuf[i].urb = urb;
- urb->dev = cam->dev;
+ usb_fill_int_urb(urb, cam->dev, usb_rcvisocpipe(cam->dev, 1),
+ cam->sbuf[i].data, FRAME_SIZE_PER_DESC *
+ FRAMES_PER_DESC, cpia2_usb_complete, cam, 1);
urb->context = cam;
- urb->pipe = usb_rcvisocpipe(cam->dev, 1 /*ISOC endpoint*/);
urb->transfer_flags = URB_ISO_ASAP;
- urb->transfer_buffer = cam->sbuf[i].data;
- urb->complete = cpia2_usb_complete;
- urb->number_of_packets = FRAMES_PER_DESC;
- urb->interval = 1;
- urb->transfer_buffer_length =
- FRAME_SIZE_PER_DESC * FRAMES_PER_DESC;
for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
urb->iso_frame_desc[fx].offset =
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-06-20 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 11:00 [02/27] media: cpia2_usb: use usb_fill_int_urb() Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).