diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-12-17 15:28:26 -0700 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-03 10:27:31 +0100 |
commit | f425458eafd51b6b5ab64f407922e1198c567cb2 (patch) | |
tree | a597cc8f7ba8e878f7eb1decea211173adcd44e0 /drivers/hid | |
parent | d463f4719a2fa883bc0bb1fb67e6fea2307aa6df (diff) |
HID: Use module_hid_driver macro
Use the new module_hid_driver macro in all HID drivers that have
a simple register/unregister init/exit.
This also converts the hid drivers that test for a failure of
hid_register_driver() and report the failure. Using module_hid_driver
in those drivers removes the failure message.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
54 files changed, 54 insertions, 691 deletions
diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c index 0a239885e67..7c5507e9482 100644 --- a/drivers/hid/hid-a4tech.c +++ b/drivers/hid/hid-a4tech.c @@ -146,17 +146,6 @@ static struct hid_driver a4_driver = { .probe = a4_probe, .remove = a4_remove, }; +module_hid_driver(a4_driver); -static int __init a4_init(void) -{ - return hid_register_driver(&a4_driver); -} - -static void __exit a4_exit(void) -{ - hid_unregister_driver(&a4_driver); -} - -module_init(a4_init); -module_exit(a4_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index d0f7662aacc..320a958d413 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -555,23 +555,6 @@ static struct hid_driver apple_driver = { .input_mapping = apple_input_mapping, .input_mapped = apple_input_mapped, }; +module_hid_driver(apple_driver); -static int __init apple_init(void) -{ - int ret; - - ret = hid_register_driver(&apple_driver); - if (ret) - pr_err("can't register apple driver\n"); - - return ret; -} - -static void __exit apple_exit(void) -{ - hid_unregister_driver(&apple_driver); -} - -module_init(apple_init); -module_exit(apple_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-aureal.c b/drivers/hid/hid-aureal.c index 7968187ddf7..340ba9d394a 100644 --- a/drivers/hid/hid-aureal.c +++ b/drivers/hid/hid-aureal.c @@ -37,17 +37,6 @@ static struct hid_driver aureal_driver = { .id_table = aureal_devices, .report_fixup = aureal_report_fixup, }; +module_hid_driver(aureal_driver); -static int __init aureal_init(void) -{ - return hid_register_driver(&aureal_driver); -} - -static void __exit aureal_exit(void) -{ - hid_unregister_driver(&aureal_driver); -} - -module_init(aureal_init); -module_exit(aureal_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c index 5be858dd9a1..62f0cee032b 100644 --- a/drivers/hid/hid-axff.c +++ b/drivers/hid/hid-axff.c @@ -192,19 +192,7 @@ static struct hid_driver ax_driver = { .probe = ax_probe, .remove = ax_remove, }; - -static int __init ax_init(void) -{ - return hid_register_driver(&ax_driver); -} - -static void __exit ax_exit(void) -{ - hid_unregister_driver(&ax_driver); -} - -module_init(ax_init); -module_exit(ax_exit); +module_hid_driver(ax_driver); MODULE_AUTHOR("Sergei Kolzun"); MODULE_DESCRIPTION("Force feedback support for ACRUX game controllers"); diff --git a/drivers/hid/hid-belkin.c b/drivers/hid/hid-belkin.c index a1a5a12c3a6..cc4cf138bef 100644 --- a/drivers/hid/hid-belkin.c +++ b/drivers/hid/hid-belkin.c @@ -86,17 +86,6 @@ static struct hid_driver belkin_driver = { .input_mapping = belkin_input_mapping, .probe = belkin_probe, }; +module_hid_driver(belkin_driver); -static int __init belkin_init(void) -{ - return hid_register_driver(&belkin_driver); -} - -static void __exit belkin_exit(void) -{ - hid_unregister_driver(&belkin_driver); -} - -module_init(belkin_init); -module_exit(belkin_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-cherry.c b/drivers/hid/hid-cherry.c index af034d3d925..1bdcccc54a1 100644 --- a/drivers/hid/hid-cherry.c +++ b/drivers/hid/hid-cherry.c @@ -69,17 +69,6 @@ static struct hid_driver ch_driver = { .report_fixup = ch_report_fixup, .input_mapping = ch_input_mapping, }; +module_hid_driver(ch_driver); -static int __init ch_init(void) -{ - return hid_register_driver(&ch_driver); -} - -static void __exit ch_exit(void) -{ - hid_unregister_driver(&ch_driver); -} - -module_init(ch_init); -module_exit(ch_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-chicony.c b/drivers/hid/hid-chicony.c index a2abb8e1572..b613d5a7968 100644 --- a/drivers/hid/hid-chicony.c +++ b/drivers/hid/hid-chicony.c @@ -70,17 +70,6 @@ static struct hid_driver ch_driver = { .id_table = ch_devices, .input_mapping = ch_input_mapping, }; +module_hid_driver(ch_driver); -static int __init ch_init(void) -{ - return hid_register_driver(&ch_driver); -} - -static void __exit ch_exit(void) -{ - hid_unregister_driver(&ch_driver); -} - -module_init(ch_init); -module_exit(ch_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c index 3e159a50dac..c4ef3bc726e 100644 --- a/drivers/hid/hid-cypress.c +++ b/drivers/hid/hid-cypress.c @@ -144,17 +144,6 @@ static struct hid_driver cp_driver = { .event = cp_event, .probe = cp_probe, }; +module_hid_driver(cp_driver); -static int __init cp_init(void) -{ - return hid_register_driver(&cp_driver); -} - -static void __exit cp_exit(void) -{ - hid_unregister_driver(&cp_driver); -} - -module_init(cp_init); -module_exit(cp_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c index e832f44ae38..0fe8f65ef01 100644 --- a/drivers/hid/hid-dr.c +++ b/drivers/hid/hid-dr.c @@ -297,17 +297,6 @@ static struct hid_driver dr_driver = { .report_fixup = dr_report_fixup, .probe = dr_probe, }; +module_hid_driver(dr_driver); -static int __init dr_init(void) -{ - return hid_register_driver(&dr_driver); -} - -static void __exit dr_exit(void) -{ - hid_unregister_driver(&dr_driver); -} - -module_init(dr_init); -module_exit(dr_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c index 79d0c61e721..d0bd13b62dc 100644 --- a/drivers/hid/hid-elecom.c +++ b/drivers/hid/hid-elecom.c @@ -41,17 +41,6 @@ static struct hid_driver elecom_driver = { .id_table = elecom_devices, .report_fixup = elecom_report_fixup }; +module_hid_driver(elecom_driver); -static int __init elecom_init(void) -{ - return hid_register_driver(&elecom_driver); -} - -static void __exit elecom_exit(void) -{ - hid_unregister_driver(&elecom_driver); -} - -module_init(elecom_init); -module_exit(elecom_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c index 2630d483d26..2e093ab99b4 100644 --- a/drivers/hid/hid-emsff.c +++ b/drivers/hid/hid-emsff.c @@ -150,18 +150,7 @@ static struct hid_driver ems_driver = { .id_table = ems_devices, .probe = ems_probe, }; +module_hid_driver(ems_driver); -static int ems_init(void) -{ - return hid_register_driver(&ems_driver); -} - -static void ems_exit(void) -{ - hid_unregister_driver(&ems_driver); -} - -module_init(ems_init); -module_exit(ems_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-ezkey.c b/drivers/hid/hid-ezkey.c index 6540af2871a..212ac6be245 100644 --- a/drivers/hid/hid-ezkey.c +++ b/drivers/hid/hid-ezkey.c @@ -76,17 +76,6 @@ static struct hid_driver ez_driver = { .input_mapping = ez_input_mapping, .event = ez_event, }; +module_hid_driver(ez_driver); -static int __init ez_init(void) -{ - return hid_register_driver(&ez_driver); -} - -static void __exit ez_exit(void) -{ - hid_unregister_driver(&ez_driver); -} - -module_init(ez_init); -module_exit(ez_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c index f1e1bcf6742..04d2e6aca77 100644 --- a/drivers/hid/hid-gaff.c +++ b/drivers/hid/hid-gaff.c @@ -176,17 +176,6 @@ static struct hid_driver ga_driver = { .id_table = ga_devices, .probe = ga_probe, }; +module_hid_driver(ga_driver); -static int __init ga_init(void) -{ - return hid_register_driver(&ga_driver); -} - -static void __exit ga_exit(void) -{ - hid_unregister_driver(&ga_driver); -} - -module_init(ga_init); -module_exit(ga_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-generic.c b/drivers/hid/hid-generic.c index a8b3148e03a..e288a4a06fe 100644 --- a/drivers/hid/hid-generic.c +++ b/drivers/hid/hid-generic.c @@ -34,19 +34,7 @@ static struct hid_driver hid_generic = { .name = "hid-generic", .id_table = hid_table, }; - -static int __init hid_init(void) -{ - return hid_register_driver(&hid_generic); -} - -static void __exit hid_exit(void) -{ - hid_unregister_driver(&hid_generic); -} - -module_init(hid_init); -module_exit(hid_exit); +module_hid_driver(hid_generic); MODULE_AUTHOR("Henrik Rydberg"); MODULE_DESCRIPTION("HID generic driver"); diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c index 4442c30ef53..288d61c9748 100644 --- a/drivers/hid/hid-gyration.c +++ b/drivers/hid/hid-gyration.c @@ -88,17 +88,6 @@ static struct hid_driver gyration_driver = { .input_mapping = gyration_input_mapping, .event = gyration_event, }; +module_hid_driver(gyration_driver); -static int __init gyration_init(void) -{ - return hid_register_driver(&gyration_driver); -} - -static void __exit gyration_exit(void) -{ - hid_unregister_driver(&gyration_driver); -} - -module_init(gyration_init); -module_exit(gyration_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-holtek-kbd.c b/drivers/hid/hid-holtek-kbd.c index e0a5d1739fc..6e1a4a4fc0c 100644 --- a/drivers/hid/hid-holtek-kbd.c +++ b/drivers/hid/hid-holtek-kbd.c @@ -167,17 +167,6 @@ static struct hid_driver holtek_kbd_driver = { .report_fixup = holtek_kbd_report_fixup, .probe = holtek_kbd_probe }; +module_hid_driver(holtek_kbd_driver); -static int __init holtek_kbd_init(void) -{ - return hid_register_driver(&holtek_kbd_driver); -} - -static void __exit holtek_kbd_exit(void) -{ - hid_unregister_driver(&holtek_kbd_driver); -} - -module_exit(holtek_kbd_exit); -module_init(holtek_kbd_init); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-holtekff.c b/drivers/hid/hid-holtekff.c index ff295e60059..f34d1186a3e 100644 --- a/drivers/hid/hid-holtekff.c +++ b/drivers/hid/hid-holtekff.c @@ -224,17 +224,4 @@ static struct hid_driver holtek_driver = { .id_table = holtek_devices, .probe = holtek_probe, }; - -static int __init holtek_init(void) -{ - return hid_register_driver(&holtek_driver); -} - -static void __exit holtek_exit(void) -{ - hid_unregister_driver(&holtek_driver); -} - -module_init(holtek_init); -module_exit(holtek_exit); - +module_hid_driver(holtek_driver); diff --git a/drivers/hid/hid-icade.c b/drivers/hid/hid-icade.c index 1d6565e37ba..09dcc04595f 100644 --- a/drivers/hid/hid-icade.c +++ b/drivers/hid/hid-icade.c @@ -235,25 +235,8 @@ static struct hid_driver icade_driver = { .input_mapped = icade_input_mapped, .input_mapping = icade_input_mapping, }; +module_hid_driver(icade_driver); -static int __init icade_init(void) -{ - int ret; - - ret = hid_register_driver(&icade_driver); - if (ret) - pr_err("can't register icade driver\n"); - - return ret; -} - -static void __exit icade_exit(void) -{ - hid_unregister_driver(&icade_driver); -} - -module_init(icade_init); -module_exit(icade_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Bastien Nocera <hadess@hadess.net>"); MODULE_DESCRIPTION("ION iCade input driver"); diff --git a/drivers/hid/hid-kensington.c b/drivers/hid/hid-kensington.c index a5b4016e9bd..fe9a99dd8d0 100644 --- a/drivers/hid/hid-kensington.c +++ b/drivers/hid/hid-kensington.c @@ -47,17 +47,6 @@ static struct hid_driver ks_driver = { .id_table = ks_devices, .input_mapping = ks_input_mapping, }; +module_hid_driver(ks_driver); -static int __init ks_init(void) -{ - return hid_register_driver(&ks_driver); -} - -static void __exit ks_exit(void) -{ - hid_unregister_driver(&ks_driver); -} - -module_init(ks_init); -module_exit(ks_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-keytouch.c b/drivers/hid/hid-keytouch.c index 07cd825f6f0..3074671b7d6 100644 --- a/drivers/hid/hid-keytouch.c +++ b/drivers/hid/hid-keytouch.c @@ -49,18 +49,7 @@ static struct hid_driver keytouch_driver = { .id_table = keytouch_devices, .report_fixup = keytouch_report_fixup, }; +module_hid_driver(keytouch_driver); -static int __init keytouch_init(void) -{ - return hid_register_driver(&keytouch_driver); -} - -static void __exit keytouch_exit(void) -{ - hid_unregister_driver(&keytouch_driver); -} - -module_init(keytouch_init); -module_exit(keytouch_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Jiri Kosina"); diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c index b4f0d8216fd..ef72daecfa1 100644 --- a/drivers/hid/hid-kye.c +++ b/drivers/hid/hid-kye.c @@ -419,17 +419,6 @@ static struct hid_driver kye_driver = { .probe = kye_probe, .report_fixup = kye_report_fixup, }; +module_hid_driver(kye_driver); -static int __init kye_init(void) -{ - return hid_register_driver(&kye_driver); -} - -static void __exit kye_exit(void) -{ - hid_unregister_driver(&kye_driver); -} - -module_init(kye_init); -module_exit(kye_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-lcpower.c b/drivers/hid/hid-lcpower.c index 22bc14abdfa..6424cfdb773 100644 --- a/drivers/hid/hid-lcpower.c +++ b/drivers/hid/hid-lcpower.c @@ -54,17 +54,6 @@ static struct hid_driver ts_driver = { .id_table = ts_devices, .input_mapping = ts_input_mapping, }; +module_hid_driver(ts_driver); -static int __init ts_init(void) -{ - return hid_register_driver(&ts_driver); -} - -static void __exit ts_exit(void) -{ - hid_unregister_driver(&ts_driver); -} - -module_init(ts_init); -module_exit(ts_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-lenovo-tpkbd.c b/drivers/hid/hid-lenovo-tpkbd.c index cea016e94f4..956c3b135f6 100644 --- a/drivers/hid/hid-lenovo-tpkbd.c +++ b/drivers/hid/hid-lenovo-tpkbd.c @@ -468,18 +468,6 @@ static struct hid_driver tpkbd_driver = { .probe = tpkbd_probe, .remove = tpkbd_remove, }; - -static int __init tpkbd_init(void) -{ - return hid_register_driver(&tpkbd_driver); -} - -static void __exit tpkbd_exit(void) -{ - hid_unregister_driver(&tpkbd_driver); -} - -module_init(tpkbd_init); -module_exit(tpkbd_exit); +module_hid_driver(tpkbd_driver); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index a2f8e88b9fa..e3dc73b612d 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -503,17 +503,6 @@ static struct hid_driver lg_driver = { .probe = lg_probe, .remove = lg_remove, }; +module_hid_driver(lg_driver); -static int __init lg_init(void) -{ - return hid_register_driver(&lg_driver); -} - -static void __exit lg_exit(void) -{ - hid_unregister_driver(&lg_driver); -} - -module_init(lg_init); -module_exit(lg_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 25ddf3e3aec..f7f113ba083 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -569,23 +569,6 @@ static struct hid_driver magicmouse_driver = { .raw_event = magicmouse_raw_event, .input_mapping = magicmouse_input_mapping, }; +module_hid_driver(magicmouse_driver); -static int __init magicmouse_init(void) -{ - int ret; - - ret = hid_register_driver(&magicmouse_driver); - if (ret) - pr_err("can't register magicmouse driver\n"); - - return ret; -} - -static void __exit magicmouse_exit(void) -{ - hid_unregister_driver(&magicmouse_driver); -} - -module_init(magicmouse_init); -module_exit(magicmouse_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index 6fcd466d082..29d27f65a11 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c @@ -221,17 +221,6 @@ static struct hid_driver ms_driver = { .event = ms_event, .probe = ms_probe, }; +module_hid_driver(ms_driver); -static int __init ms_init(void) -{ - return hid_register_driver(&ms_driver); -} - -static void __exit ms_exit(void) -{ - hid_unregister_driver(&ms_driver); -} - -module_init(ms_init); -module_exit(ms_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-monterey.c b/drivers/hid/hid-monterey.c index cd3643e06fa..9e14c00eb1b 100644 --- a/drivers/hid/hid-monterey.c +++ b/drivers/hid/hid-monterey.c @@ -63,17 +63,6 @@ static struct hid_driver mr_driver = { .report_fixup = mr_report_fixup, .input_mapping = mr_input_mapping, }; +module_hid_driver(mr_driver); -static int __init mr_init(void) -{ - return hid_register_driver(&mr_driver); -} - -static void __exit mr_exit(void) -{ - hid_unregister_driver(&mr_driver); -} - -module_init(mr_init); -module_exit(mr_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 61543c02ea0..46d8136daf9 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -1198,16 +1198,4 @@ static struct hid_driver mt_driver = { .resume = mt_resume, #endif }; - -static int __init mt_init(void) -{ - return hid_register_driver(&mt_driver); -} - -static void __exit mt_exit(void) -{ - hid_unregister_driver(&mt_driver); -} - -module_init(mt_init); -module_exit(mt_exit); +module_hid_driver(mt_driver); diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 86a969f6329..2ffc0e3844c 100644 --- a/drivers/hid/hid-ntrig.c +++ b/ |