From patchwork Wed Jan 11 19:56:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 42178 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3510833wrt; Wed, 11 Jan 2023 12:01:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuvl/DVIARU4ezP/rU0bvqVwOp4lJ5rftFbvUOmGSJAIjLr/xuCsLX9rPrEFaAUxJO/Crfz X-Received: by 2002:a17:907:4d8:b0:7c0:9a2f:ac93 with SMTP id vz24-20020a17090704d800b007c09a2fac93mr50300010ejb.31.1673467296647; Wed, 11 Jan 2023 12:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673467296; cv=none; d=google.com; s=arc-20160816; b=izaT1OojgQXIKfYtZRloQs0X2iDnDxKMr5mj6b3yzC4Z5eIMt99t08r1Uwy3M8Nt81 iq8oVcguo1s8QydsEeA28CKBMhxPSUkGVUjsIHpojdeq9y/KRPH6peUcJaodcfywwBb2 s+N5O2WqqisbfUUjbqpdJHf6SSIunsNfKagVknyfbSbfvJfwMHxWyUGO8PVBkvYcLjkr xWQAZqsQRyem0QhpFwZ8eyrvdlaBVRD2WPKSogRrCrjOZgAiK3yrMLz5cVuG+uDqB9Ly bnwu8ERFD1zhG6Viv6GEIc3t3CWElVKDbKt8bN8pI2zCKR41EMYx7kg4p+ou0CmZ2In8 tpNg== 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=mtmV9l7nc5rNAnRd5tDKtgcvbDQ33xbV2FWOsTfWKIg=; b=VXx6o4INPIBSYD0YZV6EfSLIq85ShxsRXpRUoaaeBY7I8+Fw8U451LSIaux2rfSqLf aO4ZZKbV0IwcsJJENicPJYC22mIR9sKu/u+lQnWNYmrotHQAE1DvneWqgUCIKfAML29Z SqiSeiPUSha3OFxzDoUDSMxik/UF2aGJlsys+C/16z00Mk/PCq5b683WWK4WKdLJch8b gG3sRJY4fPDYS7CzuUoTHFH1azbYln/Z6lo4IbeXVNT0AHkjnTHDuMFCvN2MPBHw8AzD 9nqBCj7d/+rxTrbTea9yVQqfzzL4PoPAx5xkNg/LTDbphrDpXjg6pg7bV6zclP36OAzf VmCg== 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 f7-20020a056402354700b0047b5ecde3d7si17309140edd.257.2023.01.11.12.01.12; Wed, 11 Jan 2023 12:01:36 -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 S239655AbjAKT6h (ORCPT + 99 others); Wed, 11 Jan 2023 14:58:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235401AbjAKT5N (ORCPT ); Wed, 11 Jan 2023 14:57:13 -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 5B9021C90D for ; Wed, 11 Jan 2023 11:57:12 -0800 (PST) Received: from dslb-188-096-145-172.188.096.pools.vodafone-ip.de ([188.96.145.172] 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 1pFhDf-0005F2-Aj; Wed, 11 Jan 2023 20:57:07 +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 18/20] staging: r8188eu: pass struct adapter to usb_write Date: Wed, 11 Jan 2023 20:56:38 +0100 Message-Id: <20230111195640.306748-19-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111195640.306748-1-martin@kaiser.cx> References: <20230111195640.306748-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?1754757643659964869?= X-GMAIL-MSGID: =?utf-8?q?1754757643659964869?= The usb_write function takes a struct intf_hdl only to extract the struct adapter from it. We can pass struct adapter directly. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index f8900b51d750..2784fc69f7d9 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -49,9 +49,8 @@ static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size) return status; } -static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size) +static int usb_write(struct adapter *adapt, u16 value, void *data, u8 size) { - struct adapter *adapt = intf->padapter; struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt); struct usb_device *udev = dvobjpriv->pusbdev; int status; @@ -131,49 +130,45 @@ int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data) int rtw_write8(struct adapter *adapter, u32 addr, u8 val) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; int ret; - ret = usb_write(intf, value, &val, 1); + ret = usb_write(adapter, value, &val, 1); return RTW_STATUS_CODE(ret); } int rtw_write16(struct adapter *adapter, u32 addr, u16 val) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; __le16 data = cpu_to_le16(val); int ret; - ret = usb_write(intf, value, &data, 2); + ret = usb_write(adapter, value, &data, 2); return RTW_STATUS_CODE(ret); } int rtw_write32(struct adapter *adapter, u32 addr, u32 val) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; __le32 data = cpu_to_le32(val); int ret; - ret = usb_write(intf, value, &data, 4); + ret = usb_write(adapter, value, &data, 4); return RTW_STATUS_CODE(ret); } int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; int ret; if (length > VENDOR_CMD_MAX_DATA_LEN) return _FAIL; - ret = usb_write(intf, value, data, length); + ret = usb_write(adapter, value, data, length); return RTW_STATUS_CODE(ret); }