Skip to contentSkip to conversation

HID: corsair: Convert to use module_hid_driver

PATCH Applied Axel Lin 3 participants 3 messages Dec 16, 2015 – Dec 28, 2015 HID

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 HID: corsair: Convert to use module_hid_driver

---
 drivers/hid/hid-corsair.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/hid/hid-corsair.c +1 -12
index bcefb9e..5855196 100644
@@ -655,18 +655,7 @@ static struct hid_driver corsair_driver = {
 	.input_mapping = corsair_input_mapping,
 };
 
-static int __init corsair_init(void)
-{
-	return hid_register_driver(&corsair_driver);
-}
-
-static void corsair_exit(void)
-{
-	hid_unregister_driver(&corsair_driver);
-}
-
-module_init(corsair_init);
-module_exit(corsair_exit);
+module_hid_driver(corsair_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Clement Vuchener");
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw

2015-12-16 9:56 GMT+01:00 Axel Lin <[email protected]>:

Quoted 1 line

I am not sure if I am required to ack trivial patches, but no one answered.

I have no preference toward the old or new code. If it is the prefered way to do that, I have no problem with it.

Quoted 29 lines
---
 drivers/hid/hid-corsair.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/hid/hid-corsair.c +1 -13
index bcefb9e..5855196 100644
@@ -655,18 +655,7 @@ static struct hid_driver corsair_driver = {
        .input_mapping = corsair_input_mapping,
 };
 
-static int __init corsair_init(void)
-{
-       return hid_register_driver(&corsair_driver);
-}
-
-static void corsair_exit(void)
-{
-       hid_unregister_driver(&corsair_driver);
-}
-
-module_init(corsair_init);
-module_exit(corsair_exit);
+module_hid_driver(corsair_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Clement Vuchener");
--
Quoted 4 lines

2.1.4

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

maintainer Applied
#2 lore raw
In reply to Axel Lin
Quoted 19 lines · Axel Lin
---
 drivers/hid/hid-corsair.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/hid/hid-corsair.c +0 -6
index bcefb9e..5855196 100644
@@ -655,18 +655,7 @@ static struct hid_driver corsair_driver = {
 	.input_mapping = corsair_input_mapping,
 };
 
-static int __init corsair_init(void)
-{
-	return hid_register_driver(&corsair_driver);
-}
-
-static void corsair_exit(void)

drivers/hid/hid-corsair.c static struct hid_driver corsair_driver = { · line 661

Quoted 10 lines
drivers/hid/hid-corsair.c +1 -6
-{
-	hid_unregister_driver(&corsair_driver);
-}
-
-module_init(corsair_init);
-module_exit(corsair_exit);
+module_hid_driver(corsair_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Clement Vuchener");

Applied to for-4.5/upstream.

Signature · 2 lines
Jiri Kosina
SUSE Labs