]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: most: hdm_usb: Driver registration with module_driver macro
authorAlex Briskin <br.shurik@gmail.com>
Sun, 27 Aug 2017 05:22:10 +0000 (08:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Aug 2017 17:59:10 +0000 (19:59 +0200)
Register with module_driver macro instead of module_init/module_exit.

Signed-off-by: Alex Briskin <br.shurik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/hdm-usb/hdm_usb.c

index a9c3785d19aeec4b60301d03e8661a37423d58a0..85775da293fb10d067d7956af1268eabd5727893 100644 (file)
@@ -1301,25 +1301,7 @@ static struct usb_driver hdm_usb = {
        .disconnect = hdm_disconnect,
 };
 
-static int __init hdm_usb_init(void)
-{
-       pr_info("hdm_usb_init()\n");
-       if (usb_register(&hdm_usb)) {
-               pr_err("could not register hdm_usb driver\n");
-               return -EIO;
-       }
-
-       return 0;
-}
-
-static void __exit hdm_usb_exit(void)
-{
-       pr_info("hdm_usb_exit()\n");
-       usb_deregister(&hdm_usb);
-}
-
-module_init(hdm_usb_init);
-module_exit(hdm_usb_exit);
+module_usb_driver(hdm_usb);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Christian Gromm <christian.gromm@microchip.com>");
 MODULE_DESCRIPTION("HDM_4_USB");