]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
wifi: rtl8xxxu: use module_usb_driver
authorMartin Kaiser <martin@kaiser.cx>
Tue, 7 Mar 2023 19:57:17 +0000 (20:57 +0100)
committerKalle Valo <kvalo@kernel.org>
Mon, 13 Mar 2023 13:44:01 +0000 (15:44 +0200)
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>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230307195718.168021-1-martin@kaiser.cx
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

index 47dcca842d7c37ef0239af9e1c94a05b8c5b878c..280dc3e26ca72b7a3699f3d6f903e12d6ec7a957 100644 (file)
@@ -7451,24 +7451,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);