From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: kieran.bingham@ideasonboard.com
Cc: linux-media@vger.kernel.org,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Olivier BRAUN <olivier.braun@stereolabs.com>,
Troy Kisky <troy.kisky@boundarydevices.com>,
Randy Dunlap <rdunlap@infradead.org>,
Philipp Zabel <philipp.zabel@gmail.com>,
Ezequiel Garcia <ezequiel@collabora.com>,
Tomasz Figa <tfiga@google.com>,
Keiichi Watanabe <keiichiw@chromium.org>
Subject: Re: [PATCH v6 09/10] media: uvcvideo: Rename uvc_{un,}init_video()
Date: Tue, 04 Dec 2018 15:05:35 +0200 [thread overview]
Message-ID: <10804232.MObpKYjIdb@avalon> (raw)
In-Reply-To: <d32ae7e2-3f92-9762-4c22-2d9d5ee9e26a@ideasonboard.com>
Hi Kieran,
Thank you for the patch.
On Friday, 9 November 2018 19:15:42 EET Kieran Bingham wrote:
> Hi Laurent,
>
> I'm sorry - I didn't update the commit message on this one.
>
> On 09/11/2018 17:05, Kieran Bingham wrote:
> > We have both uvc_init_video() and uvc_video_init() calls which can be
> > quite confusing to determine the process for each. Now that video
> > uvc_video_enable() has been renamed to uvc_video_start_streaming(),
> > adapt these calls to suit the new flow.
> >
> > Rename uvc_init_video() to uvc_video_start() and uvc_uninit_video() to
> > uvc_video_stop().
>
> Could you s/uvc_video_start/uvc_video_start_transfer/ and
> s/uvc_video_stop/uvc_video_stop_transfer/ when applying please?
>
> (Assuming you get to apply and don't find something else :D)
Will do.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> >
> > ---
> >
> > v6:
> > - Append _transfer to {_stop,_start}
> >
> > drivers/media/usb/uvc/uvc_video.c | 20 +++++++++++---------
> > 1 file changed, 11 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_video.c
> > b/drivers/media/usb/uvc/uvc_video.c index cd67506dc696..a81012c65280
> > 100644
> > --- a/drivers/media/usb/uvc/uvc_video.c
> > +++ b/drivers/media/usb/uvc/uvc_video.c
> > @@ -1641,7 +1641,8 @@ static int uvc_alloc_urb_buffers(struct
> > uvc_streaming *stream,
> > /*
> > * Uninitialize isochronous/bulk URBs and free transfer buffers.
> > */
> > -static void uvc_uninit_video(struct uvc_streaming *stream, int
> > free_buffers)
> > +static void uvc_video_stop_transfer(struct uvc_streaming *stream,
> > + int free_buffers)
> > {
> > struct uvc_urb *uvc_urb;
> >
> > @@ -1718,7 +1719,7 @@ static int uvc_init_video_isoc(struct uvc_streaming
> > *stream,
> >
> > urb = usb_alloc_urb(npackets, gfp_flags);
> > if (urb == NULL) {
> > - uvc_uninit_video(stream, 1);
> > + uvc_video_stop_transfer(stream, 1);
> > return -ENOMEM;
> > }
> >
> > @@ -1786,7 +1787,7 @@ static int uvc_init_video_bulk(struct uvc_streaming
> > *stream,
> >
> > urb = usb_alloc_urb(0, gfp_flags);
> > if (urb == NULL) {
> > - uvc_uninit_video(stream, 1);
> > + uvc_video_stop_transfer(stream, 1);
> > return -ENOMEM;
> > }
> >
> > @@ -1806,7 +1807,8 @@ static int uvc_init_video_bulk(struct uvc_streaming
> > *stream,
> > /*
> > * Initialize isochronous/bulk URBs and allocate transfer buffers.
> > */
> > -static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
> > +static int uvc_video_start_transfer(struct uvc_streaming *stream,
> > + gfp_t gfp_flags)
> {
> > struct usb_interface *intf = stream->intf;
> > struct usb_host_endpoint *ep;
> > @@ -1894,7 +1896,7 @@ static int uvc_init_video(struct uvc_streaming
> > *stream, gfp_t gfp_flags)
> >
> > if (ret < 0) {
> > uvc_printk(KERN_ERR, "Failed to submit URB %u "
> > "(%d).\n", i, ret);
> > - uvc_uninit_video(stream, 1);
> > + uvc_video_stop_transfer(stream, 1);
> > return ret;
> }
> > }
> > @@ -1925,7 +1927,7 @@ int uvc_video_suspend(struct uvc_streaming *stream)
> > return 0;
> >
> > stream->frozen = 1;
> > - uvc_uninit_video(stream, 0);
> > + uvc_video_stop_transfer(stream, 0);
> > usb_set_interface(stream->dev->udev, stream->intfnum, 0);
> > return 0;
> > }
> > @@ -1961,7 +1963,7 @@ int uvc_video_resume(struct uvc_streaming *stream,
> > int reset)
> >
> > if (ret < 0)
> > return ret;
> >
> > - return uvc_init_video(stream, GFP_NOIO);
> > + return uvc_video_start_transfer(stream, GFP_NOIO);
> > }
> >
> > /* ----------------------------------------------------------------------
> > @@ -2089,7 +2091,7 @@ int uvc_video_start_streaming(struct uvc_streaming
> > *stream)
> >
> > if (ret < 0)
> > goto error_commit;
> >
> > - ret = uvc_init_video(stream, GFP_KERNEL);
> > + ret = uvc_video_start_transfer(stream, GFP_KERNEL);
> > if (ret < 0)
> > goto error_video;
> >
> > @@ -2105,7 +2107,7 @@ int uvc_video_start_streaming(struct uvc_streaming
> > *stream)
> >
> > int uvc_video_stop_streaming(struct uvc_streaming *stream)
> > {
> > - uvc_uninit_video(stream, 1);
> > + uvc_video_stop_transfer(stream, 1);
> >
> > if (stream->intf->num_altsetting > 1) {
> > usb_set_interface(stream->dev->udev,
> > stream->intfnum, 0);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2018-12-04 13:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-09 17:05 [PATCH v6 00/10] Asynchronous UVC Kieran Bingham
2018-11-09 17:05 ` [PATCH v6 01/10] media: uvcvideo: Refactor URB descriptors Kieran Bingham
2018-11-09 17:05 ` [PATCH v6 02/10] media: uvcvideo: Convert decode functions to use new context structure Kieran Bingham
2018-11-09 17:05 ` [PATCH v6 03/10] media: uvcvideo: Protect queue internals with helper Kieran Bingham
2018-11-09 17:05 ` [PATCH v6 04/10] media: uvcvideo: queue: Simplify spin-lock usage Kieran Bingham
2018-11-09 17:05 ` [PATCH v6 05/10] media: uvcvideo: queue: Support asynchronous buffer handling Kieran Bingham
2018-11-10 16:30 ` Laurent Pinchart
2018-11-09 17:05 ` [PATCH v6 06/10] media: uvcvideo: Abstract streaming object lifetime Kieran Bingham
2018-12-04 12:51 ` Laurent Pinchart
2018-11-09 17:05 ` [PATCH v6 07/10] media: uvcvideo: Move decode processing to process context Kieran Bingham
2018-12-04 12:55 ` Laurent Pinchart
2018-11-09 17:05 ` [PATCH v6 08/10] media: uvcvideo: Split uvc_video_enable into two Kieran Bingham
2018-11-10 22:02 ` Kieran Bingham
2018-12-04 12:59 ` Laurent Pinchart
2018-11-09 17:05 ` [PATCH v6 09/10] media: uvcvideo: Rename uvc_{un,}init_video() Kieran Bingham
2018-11-09 17:15 ` Kieran Bingham
2018-12-04 13:05 ` Laurent Pinchart [this message]
2018-11-09 17:05 ` [PATCH v6 10/10] media: uvcvideo: Utilise for_each_uvc_urb iterator Kieran Bingham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10804232.MObpKYjIdb@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=ezequiel@collabora.com \
--cc=g.liakhovetski@gmx.de \
--cc=keiichiw@chromium.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=olivier.braun@stereolabs.com \
--cc=philipp.zabel@gmail.com \
--cc=rdunlap@infradead.org \
--cc=tfiga@google.com \
--cc=troy.kisky@boundarydevices.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox