From patchwork Mon Feb 6 20:17:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 53495 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2449112wrn; Mon, 6 Feb 2023 12:37:49 -0800 (PST) X-Google-Smtp-Source: AK7set8voo2BcgGVK4FK14NBBcsrFjrSO16vkP6DFW3WeTFOobZ+canp06h/KPDDsC7wI6GyVlaq X-Received: by 2002:a50:d0db:0:b0:4aa:a767:798c with SMTP id g27-20020a50d0db000000b004aaa767798cmr1131417edf.0.1675715869409; Mon, 06 Feb 2023 12:37:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675715869; cv=none; d=google.com; s=arc-20160816; b=JGsGP6Yw8xqIbE0BZwJCc6/CGdQJlQ6kuxuAgPDuOqdkcSYDc7Br227sQDRRDrgmMK CY+g2eT/2ta8qdgXvUWreG01jJk965OXV7C8x8gdKqhqOvUOATBHC5A7DBtpb6pN9dIt WTGH+N+GpR6R51hE+b7pcyf/8XJ29JoiqQuQ3A3X4gEZ6XBq7XSN3styZQVtISDYQsQ5 k1TYn6rpSyKF9YajwudrTzaCPSozkVLAXCzyWMmh34B5xOfM1d/DWbVq6mYFVb4c61DZ 2fcbTp9nVW7ceGuVd/UYcPrbCKFPos9teFVN7wojloI+Ak18VEyIi2wO1jRVIXm9RboN X2bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kL800BJGIG4LF5T6BaY9z3qoKZkwuQZv8Fik0X1Xngk=; b=oa7pgRx7YODd90vRwaPnzmeqYEjODUvNPTwvRAjnc79az1agLt+xwWrTIbdVUN4zwH qz0PL71EZ6g53b8WMi6OmlLws1Pr9pwpniHbU0AzWnaWhTmJYHlChQ4JMVVXaD2QRzI/ iIiRhfEBYp/VOIQA10vpqEs82+Bg8izS6B+G5QJbufZrxMZOGQGbhOvUo0UT/fGWCLQt /YRtFjB5DwHcqh0RIPZ4HJucwXHq57bPQI1tSEj41Kqe9XStpcedB3vczWgtYDDvV4B/ upZZk1wSz/quew4uaDBXxwc3G285xi1X1it82RamyR5uyKWE3oZtBdH8NHxTexF9CkB6 660g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i24-20020a0564020f1800b004974112a35dsi15939842eda.541.2023.02.06.12.37.26; Mon, 06 Feb 2023 12:37:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230172AbjBFUS6 (ORCPT + 99 others); Mon, 6 Feb 2023 15:18:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjBFUSe (ORCPT ); Mon, 6 Feb 2023 15:18:34 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02CAC3A92 for ; Mon, 6 Feb 2023 12:18:16 -0800 (PST) Received: from ipservice-092-217-084-033.092.217.pools.vodafone-ip.de ([92.217.84.33] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pP7wI-0007ps-EM; Mon, 06 Feb 2023 21:18:10 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 4/6] staging: r8188eu: remove intf_start pointer Date: Mon, 6 Feb 2023 21:17:58 +0100 Message-Id: <20230206201800.139195-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230206201800.139195-1-martin@kaiser.cx> References: <20230206201800.139195-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757115443437227026?= X-GMAIL-MSGID: =?utf-8?q?1757115443437227026?= Remove the intf_start pointer that points to a media-specific start function (pci, usb, sdio, ...). The r8188eu driver supports only usb. We could call usb_intf_start directly instead of going through the function pointer. usb_intf_start is just a call to rtl8188eu_inirp_init so we can directly replace the intf_start pointer with rtl8188eu_inirp_init. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/drv_types.h | 1 - drivers/staging/r8188eu/os_dep/os_intfs.c | 6 ++---- drivers/staging/r8188eu/os_dep/usb_intf.c | 6 ------ 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h index 7b170eed66b3..40f13f185895 100644 --- a/drivers/staging/r8188eu/include/drv_types.h +++ b/drivers/staging/r8188eu/include/drv_types.h @@ -171,7 +171,6 @@ struct adapter { s8 signal_strength; void *cmdThread; - void (*intf_start)(struct adapter *adapter); void (*intf_stop)(struct adapter *adapter); struct net_device *pnetdev; diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 4130e8fe2952..e48dbdfefedb 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -631,8 +631,7 @@ static int _netdev_open(struct net_device *pnetdev) pr_info("can't init mlme_ext_priv\n"); goto netdev_open_error; } - if (padapter->intf_start) - padapter->intf_start(padapter); + rtl8188eu_inirp_init(padapter); rtw_led_control(padapter, LED_CTL_NO_LINK); @@ -684,8 +683,7 @@ static int ips_netdrv_open(struct adapter *padapter) if (status == _FAIL) goto netdev_open_error; - if (padapter->intf_start) - padapter->intf_start(padapter); + rtl8188eu_inirp_init(padapter); rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv); _set_timer(&padapter->mlmepriv.dynamic_chk_timer, 5000); diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c index 1f114b1fc4d5..ca9a7c0e5159 100644 --- a/drivers/staging/r8188eu/os_dep/usb_intf.c +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c @@ -152,11 +152,6 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf) } -static void usb_intf_start(struct adapter *padapter) -{ - rtl8188eu_inirp_init(padapter); -} - static void usb_intf_stop(struct adapter *padapter) { /* cancel in irp */ @@ -313,7 +308,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj)); padapter = rtw_netdev_priv(pnetdev); - padapter->intf_start = &usb_intf_start; padapter->intf_stop = &usb_intf_stop; /* step read_chip_version */