From patchwork Wed Jun 20 10:40:25 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: 10476881 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 5A07D604D3 for ; Wed, 20 Jun 2018 10:42:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B84C28E19 for ; Wed, 20 Jun 2018 10:42:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FE6E28E21; Wed, 20 Jun 2018 10:42:10 +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 A555128E19 for ; Wed, 20 Jun 2018 10:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754069AbeFTKmD (ORCPT ); Wed, 20 Jun 2018 06:42:03 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59824 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753266AbeFTKmC (ORCPT ); Wed, 20 Jun 2018 06:42:02 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1fVaYp-0003Tg-Se; Wed, 20 Jun 2018 12:42:00 +0200 From: Sebastian Andrzej Siewior To: netdev@vger.kernel.org Cc: Karsten Keil , linux-usb@vger.kernel.org, tglx@linutronix.de, Sebastian Andrzej Siewior , Paul Bolle , gigaset307x-common@lists.sourceforge.net Subject: [PATCH 1/4] isdn: gigaset: use usb_fill_int_urb() Date: Wed, 20 Jun 2018 12:40:25 +0200 Message-Id: <20180620104028.18283-2-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620104028.18283-1-bigeasy@linutronix.de> References: <20180620104028.18283-1-bigeasy@linutronix.de> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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: Paul Bolle Cc: Karsten Keil Cc: gigaset307x-common@lists.sourceforge.net Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/isdn/gigaset/bas-gigaset.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 20d0a080a2b0..40c141163f0f 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c @@ -972,16 +972,14 @@ static int starturbs(struct bc_state *bcs) rc = -EFAULT; goto error; } + usb_fill_int_urb(urb, bcs->cs->hw.bas->udev, + usb_rcvisocpipe(urb->dev, 3 + 2 * bcs->channel), + ubc->isoinbuf + k * BAS_INBUFSIZE, + BAS_INBUFSIZE, read_iso_callback, bcs, + BAS_FRAMETIME); - urb->dev = bcs->cs->hw.bas->udev; - urb->pipe = usb_rcvisocpipe(urb->dev, 3 + 2 * bcs->channel); urb->transfer_flags = URB_ISO_ASAP; - urb->transfer_buffer = ubc->isoinbuf + k * BAS_INBUFSIZE; - urb->transfer_buffer_length = BAS_INBUFSIZE; urb->number_of_packets = BAS_NUMFRAMES; - urb->interval = BAS_FRAMETIME; - urb->complete = read_iso_callback; - urb->context = bcs; for (j = 0; j < BAS_NUMFRAMES; j++) { urb->iso_frame_desc[j].offset = j * BAS_MAXFRAME; urb->iso_frame_desc[j].length = BAS_MAXFRAME; @@ -1005,15 +1003,15 @@ static int starturbs(struct bc_state *bcs) rc = -EFAULT; goto error; } - urb->dev = bcs->cs->hw.bas->udev; - urb->pipe = usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel); + usb_fill_int_urb(urb, bcs->cs->hw.bas->udev, + usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel), + ubc->isooutbuf->data, + sizeof(ubc->isooutbuf->data), + write_iso_callback, &ubc->isoouturbs[k], + BAS_FRAMETIME); + urb->transfer_flags = URB_ISO_ASAP; - urb->transfer_buffer = ubc->isooutbuf->data; - urb->transfer_buffer_length = sizeof(ubc->isooutbuf->data); urb->number_of_packets = BAS_NUMFRAMES; - urb->interval = BAS_FRAMETIME; - urb->complete = write_iso_callback; - urb->context = &ubc->isoouturbs[k]; for (j = 0; j < BAS_NUMFRAMES; ++j) { urb->iso_frame_desc[j].offset = BAS_OUTBUFSIZE; urb->iso_frame_desc[j].length = BAS_NORMFRAME;