HID: use module_hid_driver() to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 23 Aug 2013 03:06:19 +0000 (11:06 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 26 Aug 2013 11:23:04 +0000 (13:23 +0200)
module_hid_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-xinmo.c

index 6153e50d97212ee42fb54249457c8fd6a8665eb4..7df5227a7e61d6ff79acd62cb009e29ffa4b79d8 100644 (file)
@@ -57,16 +57,5 @@ static struct hid_driver xinmo_driver = {
        .event = xinmo_event
 };
 
-static int __init xinmo_init(void)
-{
-       return hid_register_driver(&xinmo_driver);
-}
-
-static void __exit xinmo_exit(void)
-{
-       hid_unregister_driver(&xinmo_driver);
-}
-
-module_init(xinmo_init);
-module_exit(xinmo_exit);
+module_hid_driver(xinmo_driver);
 MODULE_LICENSE("GPL");