Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp563028imn; Wed, 3 Aug 2022 15:49:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR47IeKypf9qyqzNVjccqh0Np9bvJy5ZHIXPhZ0kOVqHbfZA9QPl0doH8s+oW6TWV9c+Mnnb X-Received: by 2002:a17:902:f78b:b0:16a:4ad:f359 with SMTP id q11-20020a170902f78b00b0016a04adf359mr28177694pln.99.1659566991947; Wed, 03 Aug 2022 15:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659566991; cv=none; d=google.com; s=arc-20160816; b=Cav58ZAWPCELcK5Xdaa5XsyK2Y9vSP2WC7hSPOC/ZAB/HIsKoPtaVjAgx6GxryVzg/ DnuiUQKOeW/CceIdhg33oWuHKpLa5rcRwIfK9916awpBFcoRhREtbC5mE5JhepOWMYVt BmwPb/rHslFyuOFQdd9nqufi/C6k+UZIyHMdsC0xdM98AYJF37QnQFmpL4ghj3lgped6 MgVn7WYqsnLRdV3mDnjqA8g53E6Gk3WC3vJaj0W/SDxfZZO90w0hY+g5zjNjhruglpNq nSEssVc8hQWv5a0fboAsgcZa7WjYCnZZIkx0xE6K5exxBkJo1KG6dpy7AP60GeR/yX99 gEzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date; bh=WcQTAlph1utfnJSRr9M90e9dz0hu23map1fVjC8icH4=; b=zbd+swAOl2b1g89Ec1VOioed2T8NCQ8K+ZheLLoEtb5n1h+6k3RTzRKN4yqw2P6v3K 5+F2uRDelxSpAaxarmFFTdzW1juoZevB22f6REaA0HvU1FQN/jIILIvqHDc0YJgqgfUR L0k75WAQJlGyHZxnhOzwaw8VD2LMsZohqJ0EL2NkJuwUh6OfSaibooQ2IWGSqFwLKjNA NylFtot2prhYP3w6QByxFPP+c/eUdP/JyDN6jq0o1HvagaBACsauATLaNDtfLYSRoyao V4yxsfIKJV1E4c0qL0PbMqKphY8c0qBZx6MHibMBmZ2npA+n3wJSL3XgbRqTqj5l1Am3 7O2w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=short.pl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020aa7948b000000b0052e1ea16f82si3404594pfk.122.2022.08.03.15.49.29; Wed, 03 Aug 2022 15:49:51 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=short.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238908AbiHCW3S (ORCPT + 99 others); Wed, 3 Aug 2022 18:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238884AbiHCW3N (ORCPT ); Wed, 3 Aug 2022 18:29:13 -0400 Received: from mx01.ayax.eu (mx01.ayax.eu [188.137.98.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 540E15C94D for ; Wed, 3 Aug 2022 15:29:11 -0700 (PDT) Received: from [192.168.192.146] (port=40528 helo=nx64de-df6d00) by mx01.ayax.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJMrB-0008T8-Ia; Thu, 04 Aug 2022 00:28:52 +0200 Date: Thu, 4 Aug 2022 00:28:48 +0200 From: Grzegorz Szymaszek To: Larry Finger , Greg KH , Phillip Potter Cc: Grzegorz Szymaszek , linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 1/3] staging: r8188eu: set firmware path in a macro Message-ID: <6c83e05e5dbccff5630ccfed9e40bf84c889b647.1659565180.git.gszymaszek@short.pl> Mail-Followup-To: Grzegorz Szymaszek , Larry Finger , Greg KH , Phillip Potter , linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS 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 The r8188eu driver requires a firmware file, the path of which was hardcoded as constant strings in two places: (1) in core/rtw_fw.c, in function load_firmware(), (2) in os_dep/os_intfs.c, in the MODULE_FIRMWARE() call. Declare the path using a macro, FW_RTL8188EU, and replace the above constant strings with the macro. That's the way it is done in many other drivers. The new macro is defined in include/drv_types.h, because that file is already included by both of the above files (or at least their headers) and because it already contains other driver constants, like its name and version. Link: https://lore.kernel.org/lkml/YuoQ37PIKzWO1zIY@kroah.com/ Suggested-by: Greg Kroah-Hartman Signed-off-by: Grzegorz Szymaszek --- drivers/staging/r8188eu/core/rtw_fw.c | 2 +- drivers/staging/r8188eu/include/drv_types.h | 1 + drivers/staging/r8188eu/os_dep/os_intfs.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_fw.c b/drivers/staging/r8188eu/core/rtw_fw.c index 0451e5177644..0fe6d4944694 100644 --- a/drivers/staging/r8188eu/core/rtw_fw.c +++ b/drivers/staging/r8188eu/core/rtw_fw.c @@ -209,7 +209,7 @@ static int load_firmware(struct rt_firmware *rtfw, struct device *device) { int ret = _SUCCESS; const struct firmware *fw; - const char *fw_name = "rtlwifi/rtl8188eufw.bin"; + const char *fw_name = FW_RTL8188EU; int err = request_firmware(&fw, fw_name, device); if (err) { diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h index bba88a0ede61..f51b83515953 100644 --- a/drivers/staging/r8188eu/include/drv_types.h +++ b/drivers/staging/r8188eu/include/drv_types.h @@ -37,6 +37,7 @@ #include "rtw_fw.h" #define DRIVERVERSION "v4.1.4_6773.20130222" +#define FW_RTL8188EU "rtlwifi/rtl8188eufw.bin" struct registry_priv { u8 chip_version; diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 5bd3022e4b40..5985054da935 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -18,7 +18,7 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); MODULE_AUTHOR("Realtek Semiconductor Corp."); MODULE_VERSION(DRIVERVERSION); -MODULE_FIRMWARE("rtlwifi/rtl8188eufw.bin"); +MODULE_FIRMWARE(FW_RTL8188EU); #define CONFIG_BR_EXT_BRNAME "br0" #define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable, */ -- 2.35.1