From patchwork Wed Jun 20 11:01:00 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: 10476983 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 4340B60383 for ; Wed, 20 Jun 2018 11:02:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3455728AD7 for ; Wed, 20 Jun 2018 11:02:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2900928B99; Wed, 20 Jun 2018 11:02:12 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD06528B47 for ; Wed, 20 Jun 2018 11:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752650AbeFTLCG (ORCPT ); Wed, 20 Jun 2018 07:02:06 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59935 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754177AbeFTLBm (ORCPT ); Wed, 20 Jun 2018 07:01:42 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1fVarq-0003m6-RJ; Wed, 20 Jun 2018 13:01:39 +0200 From: Sebastian Andrzej Siewior To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , linux-usb@vger.kernel.org, tglx@linutronix.de, Sebastian Andrzej Siewior , Sean Young Subject: [PATCH 22/27] media: ttusbir: use usb_fill_int_urb() Date: Wed, 20 Jun 2018 13:01:00 +0200 Message-Id: <20180620110105.19955-23-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620110105.19955-1-bigeasy@linutronix.de> References: <20180620110105.19955-1-bigeasy@linutronix.de> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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. Cc: Sean Young Cc: Mauro Carvalho Chehab Signed-off-by: Sebastian Andrzej Siewior --- drivers/media/rc/ttusbir.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c index aafea3c5170b..6a7c9b50ff5a 100644 --- a/drivers/media/rc/ttusbir.c +++ b/drivers/media/rc/ttusbir.c @@ -257,10 +257,6 @@ static int ttusbir_probe(struct usb_interface *intf, goto out; } - urb->dev = tt->udev; - urb->context = tt; - urb->pipe = usb_rcvisocpipe(tt->udev, tt->iso_in_endp); - urb->interval = 1; buffer = usb_alloc_coherent(tt->udev, 128, GFP_KERNEL, &urb->transfer_dma); if (!buffer) { @@ -268,11 +264,11 @@ static int ttusbir_probe(struct usb_interface *intf, ret = -ENOMEM; goto out; } + usb_fill_int_urb(urb, tt->udev, + usb_rcvisocpipe(tt->udev, tt->iso_in_endp), + buffer, 128, ttusbir_urb_complete, tt, 1); urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP | URB_ISO_ASAP; - urb->transfer_buffer = buffer; - urb->complete = ttusbir_urb_complete; urb->number_of_packets = 8; - urb->transfer_buffer_length = 128; for (j = 0; j < 8; j++) { urb->iso_frame_desc[j].offset = j * 16;