From patchwork Sat Aug 26 20:09:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13366659 X-Patchwork-Delegate: toke@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4340C83F11 for ; Sat, 26 Aug 2023 20:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbjHZUJq (ORCPT ); Sat, 26 Aug 2023 16:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjHZUJd (ORCPT ); Sat, 26 Aug 2023 16:09:33 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC78A1AD for ; Sat, 26 Aug 2023 13:09:31 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-54290603887so933171a12.1 for ; Sat, 26 Aug 2023 13:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693080571; x=1693685371; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2K0i+q1vtQDNkHEHlsAOOOf/oRQws8UMp1W1FTBoOrQ=; b=Ttm3Oq55mNfcleZmjc0pa0BeVVqCB692mdzWykwAv13oww2LtLWynq7VmvsLAEjV73 4HmEQO4xMGxrEAvwL1bLiXM6/cX2CJvqHfTK8RaabKl3DDbOO4xQHtftNe3ngHH7F/l/ xALdQVyHP8xC2oR690zLR/5nZacrgodJdX/sayZxZO8oKiF+N63xSDZwFDDpsVf7PScA R7Z6C5wAwGRmzRa0zehTtaytudSH9pG3YqxZ89gIPrKuKvz08Km82dnxnRrEwHWkFisl qqKOkGpyQZQA03a57BLVQ2IgByCcjWWExzHxv2ddGuCIY5Ymp+bOhM8QpbNyC4pXNB0W wTIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693080571; x=1693685371; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2K0i+q1vtQDNkHEHlsAOOOf/oRQws8UMp1W1FTBoOrQ=; b=GIhk3o+SjVYY8RF8QxPhp/VeISYWQU3oBzb3tsbgUJ/tdVuHUdMr7NjjC/0oZTyOXi gWF3oFjw8VFnlBRKlK5hXugc3oXhxjhSmCMaWYAh3Aox3sW9O9twfRfwjJYvwwuyrM7F 2id8hpCVvwYeyp9Y0xcdT/X83uhg6W8pdxXwgxU8Y8joIrQPlxiVKhMJ5BVqwXJo9a2H NJlfxv/f3IZU1bGYgi+qYezs23IXYPY68I+B8OvztIRCXfInx5PYjxTOIJ+Z6uMkeUwA vEu0RPEEsyroOK3qbzaeiE08pUHqC+4TolJFBYLCy0yr5XezzjsUMkGhpsXpdv0u0Scm cppw== X-Gm-Message-State: AOJu0YyxfkiG8ZcDaztD821z0uZOxew7eld+Ob6GOt4fHZ+9sp+nrqf8 lYrR5cbVlofVS43gGK2IY6ifRrVuGAhxWg== X-Google-Smtp-Source: AGHT+IEZjuC/o/R5Fv/jWOv2zECxTG8UDWttlbWILZ7O6s4j7uszeITkuMWt5ZLL67V/Q7TMksPH3A== X-Received: by 2002:a17:902:6b0c:b0:1b7:f64b:378a with SMTP id o12-20020a1709026b0c00b001b7f64b378amr16415480plk.16.1693080570924; Sat, 26 Aug 2023 13:09:30 -0700 (PDT) Received: from ryzen.lan ([2601:648:8600:e71::a86]) by smtp.gmail.com with ESMTPSA id f5-20020a170902ce8500b001b04c2023e3sm4119718plg.218.2023.08.26.13.09.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Aug 2023 13:09:30 -0700 (PDT) From: Rosen Penev To: linux-wireless@vger.kernel.org Subject: [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver Date: Sat, 26 Aug 2023 13:09:05 -0700 Message-ID: <20230826200929.9756-1-rosenp@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This follows the pattern with other USB Wifi drivers. There is nothing special being done in the _init and _exit functions here. Simplifies and saves some lines of code. Signed-off-by: Rosen Penev --- drivers/net/wireless/ath/ath9k/hif_usb.c | 10 ---------- drivers/net/wireless/ath/ath9k/hif_usb.h | 2 -- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 18 +----------------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 27ff1ca2631f..e261e4258f0a 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -1535,13 +1535,3 @@ static struct usb_driver ath9k_hif_usb_driver = { .soft_unbind = 1, .disable_hub_initiated_lpm = 1, }; - -int ath9k_hif_usb_init(void) -{ - return usb_register(&ath9k_hif_usb_driver); -} - -void ath9k_hif_usb_exit(void) -{ - usb_deregister(&ath9k_hif_usb_driver); -} diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h index 5985aa15ca93..6a7da71c9da6 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.h +++ b/drivers/net/wireless/ath/ath9k/hif_usb.h @@ -136,8 +136,6 @@ struct hif_device_usb { u8 flags; /* HIF_USB_* */ }; -int ath9k_hif_usb_init(void); -void ath9k_hif_usb_exit(void); void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev); #endif /* HTC_USB_H */ diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index dae3d9c7b640..beaaa31f32a5 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -1018,20 +1018,4 @@ int ath9k_htc_resume(struct htc_target *htc_handle) } #endif -static int __init ath9k_htc_init(void) -{ - if (ath9k_hif_usb_init() < 0) { - pr_err("No USB devices found, driver not installed\n"); - return -ENODEV; - } - - return 0; -} -module_init(ath9k_htc_init); - -static void __exit ath9k_htc_exit(void) -{ - ath9k_hif_usb_exit(); - pr_info("Driver unloaded\n"); -} -module_exit(ath9k_htc_exit); +module_usb_driver(ath9k_hif_usb_driver) From patchwork Sat Aug 26 20:09:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13366658 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DED4CC83F16 for ; Sat, 26 Aug 2023 20:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjHZUJr (ORCPT ); Sat, 26 Aug 2023 16:09:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjHZUJf (ORCPT ); Sat, 26 Aug 2023 16:09:35 -0400 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E19FCD5 for ; Sat, 26 Aug 2023 13:09:32 -0700 (PDT) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1c4c7a83bcdso1392807fac.0 for ; Sat, 26 Aug 2023 13:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693080572; x=1693685372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GlIiP1fGP9ZCizSII8WfFUp1ZP6G/2K5nC/wtrwHeME=; b=U0k6D1HyGT6DrC9w5C/cPVjRipdsEXtq2FGkJU3SbXLv1601ZzXobLKR+9CtQ2+E/U jYUbMjH6vmZQj6KFqpugUEDr4nFCQLp9D/Gq5cNRGPYcNAtNijOMVUItvec3HFei+S7s 4y68HnQYIOhklAqWXzgvEoIKhDarSwWKehC/bN/uwSEkuzRBMi0z2sr2UFRlxHZUCxV4 OqEtyYXy9EfyCFfto9e+TFUph4pQKacHmaTb64+DjPJ2WkwNi2A2OjevHC/lYzRZvTGW CK/R7VRGzJQOEeniAcpvzIcG7/V7BMuYvDhkfuJb83btW/lhYcXiMiYRi7zt+m79rVDo 7jyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693080572; x=1693685372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GlIiP1fGP9ZCizSII8WfFUp1ZP6G/2K5nC/wtrwHeME=; b=NbzPRPRs0lg0atVEPjjd94TG6njegCQfmzOFDCRxsySLkaCfqQeRrYJyz3m0uVKeUk WpCvlMAUVz4WYigKuyDCKamBZzJMGx18Y8M+bJ4j5fgnxYbSuJymClQMfwtwgasgJCjG hECasEqbQYiXjJiQkYw4W34qq2sab/Kyua20Vo88H0Oj6jh9PHv5fONYEUOfJNaIjpMi fbL0D/3EQMuj5sAKmeehEGCMzSiApFCxhSGvxdRo4QBwKzB8tbUdlxIGgfRC6AT141K7 aMGMUooSh8tHmPYggb18XCeuz8ofeBSAc7Kw+s+YKff006In6kwho1S8alioWGJ6y2uT qS/g== X-Gm-Message-State: AOJu0YyupQ4rxUXWF671dJ5gMACt1I3Uoh+CSyPOV3xiS/pEm4dhZAI8 l5mdzG1jAXpLvfHgckqJZZ1Fxtnlgx5jkg== X-Google-Smtp-Source: AGHT+IG2YdL3naOcHyvJadjsQnELa0Ul3ns68RmikpCjsc8DP5wuJLKCnABJ23AEvRTGzg9wqn3zJQ== X-Received: by 2002:a05:6870:5693:b0:1be:dbd9:dd21 with SMTP id p19-20020a056870569300b001bedbd9dd21mr6855664oao.48.1693080571679; Sat, 26 Aug 2023 13:09:31 -0700 (PDT) Received: from ryzen.lan ([2601:648:8600:e71::a86]) by smtp.gmail.com with ESMTPSA id f5-20020a170902ce8500b001b04c2023e3sm4119718plg.218.2023.08.26.13.09.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Aug 2023 13:09:31 -0700 (PDT) From: Rosen Penev To: linux-wireless@vger.kernel.org Subject: [PATCH 2/2] wifi: purelifi: use module_usb_driver Date: Sat, 26 Aug 2023 13:09:06 -0700 Message-ID: <20230826200929.9756-2-rosenp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230826200929.9756-1-rosenp@gmail.com> References: <20230826200929.9756-1-rosenp@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This follows the pattern with other USB Wifi drivers. There is nothing special being done in the _init and _exit functions here. Simplifies and saves some lines of code. Signed-off-by: Rosen Penev --- drivers/net/wireless/purelifi/plfxlc/usb.c | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c index 76d0a778636a..b4bb32911d9f 100644 --- a/drivers/net/wireless/purelifi/plfxlc/usb.c +++ b/drivers/net/wireless/purelifi/plfxlc/usb.c @@ -861,26 +861,6 @@ static struct usb_driver driver = { .disable_hub_initiated_lpm = 1, }; -static int __init usb_init(void) -{ - int r; - - r = usb_register(&driver); - if (r) { - pr_err("%s usb_register() failed %d\n", driver.name, r); - return r; - } - - pr_debug("Driver initialized :%s\n", driver.name); - return 0; -} - -static void __exit usb_exit(void) -{ - usb_deregister(&driver); - pr_debug("%s %s\n", driver.name, __func__); -} - MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("USB driver for pureLiFi devices"); MODULE_AUTHOR("pureLiFi"); @@ -888,5 +868,4 @@ MODULE_VERSION("1.0"); MODULE_FIRMWARE("plfxlc/lifi-x.bin"); MODULE_DEVICE_TABLE(usb, usb_ids); -module_init(usb_init); -module_exit(usb_exit); +module_usb_driver(driver);