From patchwork Mon Jul 2 11:28:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Miguel_Rodr=C3=ADguez_P=C3=A9rez?= X-Patchwork-Id: 10501163 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 ED6A760325 for ; Mon, 2 Jul 2018 11:28:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCB4728776 for ; Mon, 2 Jul 2018 11:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0482287A0; Mon, 2 Jul 2018 11:28:44 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 7BC1F28776 for ; Mon, 2 Jul 2018 11:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030280AbeGBL2n (ORCPT ); Mon, 2 Jul 2018 07:28:43 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52443 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965174AbeGBL2l (ORCPT ); Mon, 2 Jul 2018 07:28:41 -0400 Received: by mail-wm0-f67.google.com with SMTP id w16-v6so7985327wmc.2 for ; Mon, 02 Jul 2018 04:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=det.uvigo.gal; s=clouddet; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:mime-version:content-transfer-encoding; bh=WZ7OPd0w4GxfiqHpRbwXnjbSCXqVEMUsaI0e793be1s=; b=mAV9JLrH1xUxGsZ700O4S+H7BnTxMt+bQy9giOCH2oxrv2C+hbBZy+sJWEJ5oNDuJF +zosEkAhcsCbCh6gFAhPmehaC+ay41LISqHNOkcMJNuya7YcqlSClCdzCXw2DzyFNXEp rTQPeMex/WrjQB7B3oNpoup07A+hCw9AqKgNg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references:mime-version :content-transfer-encoding; bh=WZ7OPd0w4GxfiqHpRbwXnjbSCXqVEMUsaI0e793be1s=; b=VYg3wvs5kkvga46kHSHjKxrC4NCWh+R3yFfZYSbtuYmQi1GmSkWXjXROP/icZvKHIy N/La/jB2u/aBXHGtmymIVynyvYTEl2BTlMrz6SKeJJWjj7lVWYldUylGsUoDN86VGBA+ 3q3z1TS+29SamHG7KluOU6zAC2KHT7i6CWMQGzNQE1sVmcmS19f61wEHt/0GXojbyE3H /dRh4dXo2x+sJtegwZ3iJoNLNmAtI6sfhUo8evVszStKDRJ2wxNP4NYKS6dN2qyFzPVR IcyAJQr9+hidi/fc/xr35uyMeoiyAwDqsBxvPHcqRFAobQEOS+cfbfIMrVuF/SA8c302 1+KA== X-Gm-Message-State: APt69E0JdowYvg/hTCep8DgKtOFcXws2065WjSl7b29XeTZp029Eb7/G 2cG7UVaL5gZKzy/9eYyyNm2sJw== X-Google-Smtp-Source: AAOMgpfHvfcd/6OYvaPKYgXYaBM/TZ34FIh6rwn1iniWDBt8gmcdBm6qZ5EmqJW0EU+/X7FaZUx3TA== X-Received: by 2002:a1c:5e90:: with SMTP id s138-v6mr8263717wmb.96.1530530920164; Mon, 02 Jul 2018 04:28:40 -0700 (PDT) Received: from arthurxps.det.uvigo.es ([2001:720:1214:2042:a5d3:852d:177c:2e27]) by smtp.gmail.com with ESMTPSA id h193-v6sm16163557wmd.25.2018.07.02.04.28.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 04:28:39 -0700 (PDT) From: =?UTF-8?q?Miguel=20Rodr=C3=ADguez=20P=C3=A9rez?= To: oliver@neukum.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, gregkh@linuxfoundation.org Cc: =?UTF-8?q?Miguel=20Rodr=C3=ADguez=20P=C3=A9rez?= Subject: [PATCH v4 1/4] Use dev->intf to get interface information Date: Mon, 2 Jul 2018 13:28:33 +0200 Message-Id: <20180702112833.9907-1-miguel@det.uvigo.gal> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180701081550.GA7048@kroah.com> References: <20180701081550.GA7048@kroah.com> In-Reply-To: References: 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 usbnet_cdc_update_filter was getting the interface number from the usb_interface struct in cdc_state->control. However, cdc_ncm does not initialize that structure in its bind function, but uses cdc_ncm_cts instead. Getting intf directly from struct usbnet solves the problem. Signed-off-by: Miguel Rodríguez Pérez --- drivers/net/usb/cdc_ether.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 178b956501a7..beac02cbde51 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c @@ -77,8 +77,6 @@ static const u8 mbm_guid[16] = { static void usbnet_cdc_update_filter(struct usbnet *dev) { - struct cdc_state *info = (void *) &dev->data; - struct usb_interface *intf = info->control; struct net_device *net = dev->net; u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED @@ -98,7 +96,7 @@ static void usbnet_cdc_update_filter(struct usbnet *dev) USB_CDC_SET_ETHERNET_PACKET_FILTER, USB_TYPE_CLASS | USB_RECIP_INTERFACE, cdc_filter, - intf->cur_altsetting->desc.bInterfaceNumber, + dev->intf->cur_altsetting->desc.bInterfaceNumber, NULL, 0, USB_CTRL_SET_TIMEOUT