Message ID | CAPgLHd-B1fsT0fAbJZq2KZEZW4wOogC=_cBKiS67Mp4PXtkDbw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Jiri Kosina |
Headers | show |
On Wed, 29 May 2013, Wei Yongjun wrote: > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> > > module_hid_driver() makes the code simpler by eliminating > boilerplate code. > > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> > --- > drivers/hid/hid-holtek-mouse.c | 13 +------------ > 1 file changed, 1 insertion(+), 12 deletions(-) > > diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c > index 6a23ee6..7e6db3c 100644 > --- a/drivers/hid/hid-holtek-mouse.c > +++ b/drivers/hid/hid-holtek-mouse.c > @@ -73,16 +73,5 @@ static struct hid_driver holtek_mouse_driver = { > .report_fixup = holtek_mouse_report_fixup, > }; > > -static int __init holtek_mouse_init(void) > -{ > - return hid_register_driver(&holtek_mouse_driver); > -} > - > -static void __exit holtek_mouse_exit(void) > -{ > - hid_unregister_driver(&holtek_mouse_driver); > -} > - > -module_exit(holtek_mouse_exit); > -module_init(holtek_mouse_init); > +module_hid_driver(holtek_mouse_driver); > MODULE_LICENSE("GPL"); Added Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com> and applied, thanks.
diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c index 6a23ee6..7e6db3c 100644 --- a/drivers/hid/hid-holtek-mouse.c +++ b/drivers/hid/hid-holtek-mouse.c @@ -73,16 +73,5 @@ static struct hid_driver holtek_mouse_driver = { .report_fixup = holtek_mouse_report_fixup, }; -static int __init holtek_mouse_init(void) -{ - return hid_register_driver(&holtek_mouse_driver); -} - -static void __exit holtek_mouse_exit(void) -{ - hid_unregister_driver(&holtek_mouse_driver); -} - -module_exit(holtek_mouse_exit); -module_init(holtek_mouse_init); +module_hid_driver(holtek_mouse_driver); MODULE_LICENSE("GPL");