From patchwork Tue Jun 19 21:55:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 10475543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C087360230 for ; Tue, 19 Jun 2018 21:55:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B14F528CCE for ; Tue, 19 Jun 2018 21:55:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5B8C28CD4; Tue, 19 Jun 2018 21:55:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF5AA28CCE for ; Tue, 19 Jun 2018 21:55:45 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 43A712675FB; Tue, 19 Jun 2018 23:55:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0A49626760F; Tue, 19 Jun 2018 23:55:34 +0200 (CEST) Received: from Galois.linutronix.de (galois.linutronix.de [146.0.238.70]) by alsa0.perex.cz (Postfix) with ESMTP id 95F1D2675EC for ; Tue, 19 Jun 2018 23:55:31 +0200 (CEST) Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1fVOb3-0004KO-N8; Tue, 19 Jun 2018 23:55:29 +0200 From: Sebastian Andrzej Siewior To: alsa-devel@alsa-project.org Date: Tue, 19 Jun 2018 23:55:14 +0200 Message-Id: <20180619215521.13688-3-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180619215521.13688-1-bigeasy@linutronix.de> References: <20180619215521.13688-1-bigeasy@linutronix.de> MIME-Version: 1.0 Cc: tglx@linutronix.de, linux-usb@vger.kernel.org, Takashi Iwai , Sebastian Andrzej Siewior Subject: [alsa-devel] [PATCH 2/9] ALSA: line6: use usb_fill_int_urb() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Data pointer & size is filled out later so they are not considered. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/line6/capture.c | 16 ++++++---------- sound/usb/line6/playback.c | 16 ++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/sound/usb/line6/capture.c b/sound/usb/line6/capture.c index d8a14d769f48..4ee54ba436df 100644 --- a/sound/usb/line6/capture.c +++ b/sound/usb/line6/capture.c @@ -52,7 +52,6 @@ static int submit_audio_in_urb(struct snd_line6_pcm *line6pcm) line6pcm->in.buffer + index * LINE6_ISO_PACKETS * line6pcm->max_packet_size_in; urb_in->transfer_buffer_length = urb_size; - urb_in->context = line6pcm; ret = usb_submit_urb(urb_in, GFP_ATOMIC); @@ -280,17 +279,14 @@ int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm) if (urb == NULL) return -ENOMEM; - urb->dev = line6->usbdev; - urb->pipe = - usb_rcvisocpipe(line6->usbdev, - line6->properties->ep_audio_r & - USB_ENDPOINT_NUMBER_MASK); + usb_fill_int_urb(urb, line6->usbdev, + usb_rcvisocpipe(line6->usbdev, + line6->properties->ep_audio_r & + USB_ENDPOINT_NUMBER_MASK), + NULL, 0, audio_in_callback, line6pcm, + LINE6_ISO_INTERVAL); urb->transfer_flags = URB_ISO_ASAP; - urb->start_frame = -1; urb->number_of_packets = LINE6_ISO_PACKETS; - urb->interval = LINE6_ISO_INTERVAL; - urb->error_count = 0; - urb->complete = audio_in_callback; } return 0; diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c index dec89d2beb57..af1ca09c260e 100644 --- a/sound/usb/line6/playback.c +++ b/sound/usb/line6/playback.c @@ -202,7 +202,6 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) line6pcm->out.buffer + index * LINE6_ISO_PACKETS * line6pcm->max_packet_size_out; urb_out->transfer_buffer_length = urb_size; - urb_out->context = line6pcm; if (test_bit(LINE6_STREAM_PCM, &line6pcm->out.running) && !test_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags)) { @@ -425,17 +424,14 @@ int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm) if (urb == NULL) return -ENOMEM; - urb->dev = line6->usbdev; - urb->pipe = - usb_sndisocpipe(line6->usbdev, - line6->properties->ep_audio_w & - USB_ENDPOINT_NUMBER_MASK); + usb_fill_int_urb(urb, line6->usbdev, + usb_sndisocpipe(line6->usbdev, + line6->properties->ep_audio_w & + USB_ENDPOINT_NUMBER_MASK), + NULL, 0, audio_out_callback, line6pcm, + LINE6_ISO_INTERVAL); urb->transfer_flags = URB_ISO_ASAP; - urb->start_frame = -1; urb->number_of_packets = LINE6_ISO_PACKETS; - urb->interval = LINE6_ISO_INTERVAL; - urb->error_count = 0; - urb->complete = audio_out_callback; } return 0;