ch9200: Convert to use module_usb_driver
authorTobias Klauser <tklauser@distanz.ch>
Tue, 22 Sep 2015 07:29:49 +0000 (09:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Sep 2015 00:34:57 +0000 (17:34 -0700)
Converts the ch9200 driver to use the module_usb_driver() macro which
makes the code smaller and a bit simpler.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/ch9200.c

index cabb670eb55c040afba3c05a797864527a2f849c..5e151e6a3e0930fc0d19bef757ae1507925a8de6 100644 (file)
@@ -426,18 +426,7 @@ static struct usb_driver ch9200_driver = {
        .resume = usbnet_resume,
 };
 
-static int __init ch9200_init(void)
-{
-       return usb_register(&ch9200_driver);
-}
-
-static void __exit ch9200_exit(void)
-{
-       usb_deregister(&ch9200_driver);
-}
-
-module_init(ch9200_init);
-module_exit(ch9200_exit);
+module_usb_driver(ch9200_driver);
 
 MODULE_DESCRIPTION("QinHeng CH9200 USB Network device");
 MODULE_LICENSE("GPL");