diff mbox

[-next] HID: holtek-mouse: use module_hid_driver() to simplify the code

Message ID CAPgLHd-B1fsT0fAbJZq2KZEZW4wOogC=_cBKiS67Mp4PXtkDbw@mail.gmail.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Wei Yongjun May 29, 2013, 10:09 a.m. UTC
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(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jiri Kosina May 29, 2013, 1:05 p.m. UTC | #1
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 mbox

Patch

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");