public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: philipp hortmann <philipp.g.hortmann@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Jes Sorensen <Jes.Sorensen@gmail.com>,
	Kalle Valo <kvalo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: rtl8xxxu: use module_usb_driver
Date: Thu, 9 Mar 2023 00:05:21 +0100	[thread overview]
Message-ID: <20230308230521.GA8064@matrix-ESPRIMO-P710> (raw)
In-Reply-To: <20230307195718.168021-1-martin@kaiser.cx>

On Tue, Mar 07, 2023 at 08:57:17PM +0100, Martin Kaiser wrote:
> We can use the module_usb_driver macro instead of open-coding the driver's
> init and exit functions. This is simpler and saves some lines of code.
> Other realtek wireless drivers use module_usb_driver as well.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 20 +------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index e619ed21fbfe..58dbad9a14c2 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -7455,24 +7455,6 @@ static struct usb_driver rtl8xxxu_driver = {
>  	.disable_hub_initiated_lpm = 1,
>  };
>  
> -static int __init rtl8xxxu_module_init(void)
> -{
> -	int res;
> -
> -	res = usb_register(&rtl8xxxu_driver);
> -	if (res < 0)
> -		pr_err(DRIVER_NAME ": usb_register() failed (%i)\n", res);
> -
> -	return res;
> -}
> -
> -static void __exit rtl8xxxu_module_exit(void)
> -{
> -	usb_deregister(&rtl8xxxu_driver);
> -}
> -
> -
>  MODULE_DEVICE_TABLE(usb, dev_table);
>  
> -module_init(rtl8xxxu_module_init);
> -module_exit(rtl8xxxu_module_exit);
> +module_usb_driver(rtl8xxxu_driver);
> -- 
> 2.30.2

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150


  parent reply	other threads:[~2023-03-08 23:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 19:57 [PATCH] wifi: rtl8xxxu: use module_usb_driver Martin Kaiser
2023-03-08  6:21 ` Ping-Ke Shih
2023-03-08 23:05 ` philipp hortmann [this message]
2023-03-13 13:44 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230308230521.GA8064@matrix-ESPRIMO-P710 \
    --to=philipp.g.hortmann@gmail.com \
    --cc=Jes.Sorensen@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=martin@kaiser.cx \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox