diff mbox

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

Message ID CAPgLHd9pb+49BC7BOOSrgkOWMQJQ76GcEGStt-UeaqGqtYfpFQ@mail.gmail.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Wei Yongjun Aug. 23, 2013, 3:06 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-xinmo.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 Aug. 26, 2013, 11:23 a.m. UTC | #1
On Fri, 23 Aug 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-xinmo.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/hid/hid-xinmo.c b/drivers/hid/hid-xinmo.c
> index 6153e50..7df5227 100644
> --- a/drivers/hid/hid-xinmo.c
> +++ b/drivers/hid/hid-xinmo.c
> @@ -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");

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/hid/hid-xinmo.c b/drivers/hid/hid-xinmo.c
index 6153e50..7df5227 100644
--- a/drivers/hid/hid-xinmo.c
+++ b/drivers/hid/hid-xinmo.c
@@ -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");