From patchwork Mon Feb 6 20:18:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 53497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2449878wrn; Mon, 6 Feb 2023 12:39:31 -0800 (PST) X-Google-Smtp-Source: AK7set8ffgZaNQMxk+p4RpMX985psKxKs6Adv73hQwSPXxAkh+Jir0YcD+l5P1Y9sWj9JWD8Xg0J X-Received: by 2002:a17:906:b30d:b0:88c:a14a:d039 with SMTP id n13-20020a170906b30d00b0088ca14ad039mr592163ejz.69.1675715971574; Mon, 06 Feb 2023 12:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675715971; cv=none; d=google.com; s=arc-20160816; b=yUpTYXJxlYmDy9jN+uBr/ZG30JJNBJMozoclM0e+/eSKeuKtNuk0PHfaKq/gy0ZK8c GDDmDHtKnT/ouJQFqOaEYjjxC5jVkZ66Dh4uUdq7xMzpuTVxmXo9uqvLE4qV+mvoc4Dc J3w6gmw++1Mgwe4RQU7y2WDHOIS+xZeyIaAL5jCmT/CpWH/5np9HlVa+ZM5koRBogFsf FbQoVk73jf35WjmZX4NTn1KLL8lxQWAnjHQwMHWXRZRje5kINR4+HdRRJ3kqscR4WtC5 VT+nW+YE471dX8rVVbyAxHtWqmNKl3FJrMtwrcUuVDUXsaPrHtPT3HHcp+jd6Pg4O8S+ Ga9w== 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=w/NSELd6snl1ODrjC11g6PlptyMJ4ANFBdeVAxy35Vw=; b=K8qE941nXViqcJxoFQ/jIWPPyydD1lmq5rlkoO5fZo1djocAylOF8xp1j2n75vX6pv tTzZHUerPJlVVyDXI4BSSr4kVgVeo4s1ie+tUG8ACg3PC/rtwB2MmgBvsYmwR81DZRyD Yr6FLzY0KGj9RQWfyu8Pq4Rb5UCh2NQG7kMMuGgPHcEoojQCLjFoRnsOAaUYYbYtlcmw WX4ERdYuZI7BIKm82OpJeU9SjCMtASYCwO8B0ZNbowA5cU64HfSpPMCg+/fGn6hw6uW1 oaNsllZKSfa3s69G4x4ktrixJBNFO3HWbFD0BvQAWiPdmKPLJpW1DRdJIAGtuesmILEi /Ayw== 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 oh10-20020a17090784ca00b0088fa742b8dasi10412173ejc.653.2023.02.06.12.39.07; Mon, 06 Feb 2023 12:39:31 -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 S230215AbjBFUTE (ORCPT + 99 others); Mon, 6 Feb 2023 15:19:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjBFUSf (ORCPT ); Mon, 6 Feb 2023 15:18:35 -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 07F907A81 for ; Mon, 6 Feb 2023 12:18:17 -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 1pP7wK-0007ps-53; Mon, 06 Feb 2023 21:18:12 +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 6/6] staging: r8188eu: remove intf_stop pointer Date: Mon, 6 Feb 2023 21:18:00 +0100 Message-Id: <20230206201800.139195-7-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?1757115550332563347?= X-GMAIL-MSGID: =?utf-8?q?1757115550332563347?= Remove the intf_stop pointer that points to a media-specific stop function. The r8188eu driver supports only usb. For usb drivers, intf_stop points to usb_intf_stop, which is only two lines long. We can remove intf_stop and usb_intf_stop and call the two cancel functions directly. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/drv_types.h | 1 - drivers/staging/r8188eu/os_dep/os_intfs.c | 4 ++-- drivers/staging/r8188eu/os_dep/usb_intf.c | 18 +++--------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h index 40f13f185895..159990facb8a 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_stop)(struct adapter *adapter); struct net_device *pnetdev; /* used by rtw_rereg_nd_name related function */ diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index bd3c17f580c8..dc419fd1ffa5 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -761,8 +761,8 @@ void rtw_ips_dev_unload(struct adapter *padapter) { rtw_fifo_cleanup(padapter); - if (padapter->intf_stop) - padapter->intf_stop(padapter); + rtw_read_port_cancel(padapter); + rtw_write_port_cancel(padapter); /* s5. */ if (!padapter->bSurpriseRemoved) diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c index ca9a7c0e5159..74a16d1757ce 100644 --- a/drivers/staging/r8188eu/os_dep/usb_intf.c +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c @@ -152,17 +152,6 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf) } -static void usb_intf_stop(struct adapter *padapter) -{ - /* cancel in irp */ - rtw_read_port_cancel(padapter); - - /* cancel out irp */ - rtw_write_port_cancel(padapter); - - /* todo:cancel other irps */ -} - static void rtw_dev_unload(struct adapter *padapter) { if (padapter->bup) { @@ -170,8 +159,9 @@ static void rtw_dev_unload(struct adapter *padapter) if (padapter->xmitpriv.ack_tx) rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP); /* s3. */ - if (padapter->intf_stop) - padapter->intf_stop(padapter); + rtw_read_port_cancel(padapter); + rtw_write_port_cancel(padapter); + /* s4. */ rtw_stop_drv_threads(padapter); @@ -308,8 +298,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_stop = &usb_intf_stop; - /* step read_chip_version */ rtl8188e_read_chip_version(padapter);