From patchwork Mon Jan 23 20:53:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47382 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811081wrn; Mon, 23 Jan 2023 12:56:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXtV/VSQCdIP7EZjcSJD4krjwwsd54yGRHEFH/ZJrRicC5iReFz5WrRfA3lnm9FS6ZMG+/tj X-Received: by 2002:a17:906:514:b0:7c1:1ada:5e1e with SMTP id j20-20020a170906051400b007c11ada5e1emr26795828eja.26.1674507384354; Mon, 23 Jan 2023 12:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507384; cv=none; d=google.com; s=arc-20160816; b=ma4XjDXt/sY6IjMASLDFaRD9ivAh4dUCbdCpb8vSLB+IKZwP1TNgjKMTgnd/If8Q/L vrjnlOW+3QPllN9Bs48QL4xRCOAYWw2n/hghL87smmt62ScDzGSTtCsXU7/X9myizbvH mZSMLZckRxuhG5qaNCYNV93xaoUz+LQOV1egmJVZH/TDUbCMlkl05qcPQ/zNEjY7Hty1 G9WtsJ7J6sQRpqWHI0nGJtNDFHreVP5e2KA5dTpPD0L7TUG9BZY/B9uwegsmE7QqVcNc HE3qtKg6vRJVjCDw0tg2RmvIbgrrSPMTrO7g7xf45xzUKZlf1icR8J5Hoe71sSxUVwaV v/0Q== 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=lIUtaP8l8gzOTNyJnWjB4W6hadiqMYf0s7jx4vFGzh0=; b=IEQ55q307Vi5zXs3I3Xcs1Z6LTterVTozopxx8ptOBm20uRgBCISrkTo7I2mBRhbzd zG42+XSQwkp2MN2HMCPJHDIhqLtRzYR5E4r3cJdCNXt2XJ94jbKbS/5vPZZ2BE2kbb4q nq95oP+v6spUorHBfR+sN4vTgzO96F679DmCx7hbvwsDCY4O5rCmVBpHsDU04c0Uc25F wWH4nycV8NFaV8/v0M75UNSHpNyCdGM3cZ5yNyRKOrwrBfIhEnTQslZsHVKpoaKxbFCe sqjwtsh7X/Okd4000zLCjtiu4V5oIIlaQvJq4DQExsMPHahpZO1SmvGmG3r6P90B0tiW LZSA== 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 he37-20020a1709073da500b008719e7f3355si7015994ejc.710.2023.01.23.12.56.00; Mon, 23 Jan 2023 12:56:24 -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 S231771AbjAWUyE (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjAWUyC (ORCPT ); Mon, 23 Jan 2023 15:54:02 -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 D8CBD7DB5 for ; Mon, 23 Jan 2023 12:54:01 -0800 (PST) Received: from ipservice-092-217-089-134.092.217.pools.vodafone-ip.de ([92.217.89.134] 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 1pK3pE-0000Lk-TD; Mon, 23 Jan 2023 21:53:56 +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 02/23] staging: r8188eu: pass struct adapter to usb_write Date: Mon, 23 Jan 2023 21:53:21 +0100 Message-Id: <20230123205342.229589-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230123205342.229589-1-martin@kaiser.cx> References: <20230123205342.229589-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?1755848255148144257?= X-GMAIL-MSGID: =?utf-8?q?1755848255148144257?= 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 d82abfcd91f3..9f008e61a6f2 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,48 +130,44 @@ 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; if (length > VENDOR_CMD_MAX_DATA_LEN) return -EINVAL; - return usb_write(intf, value, data, length); + return usb_write(adapter, value, data, length); } static void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)