[PATCH 1/2] HID: i2c-hid: Expand module_i2c_driver macro
From: Hans de Goede <hidden>
Date: 2017-06-18 10:14:54
Subsystem:
hid core layer, the rest · Maintainers:
Jiri Kosina, Benjamin Tissoires, Linus Torvalds
From: Hans de Goede <hidden>
Date: 2017-06-18 10:14:54
Subsystem:
hid core layer, the rest · Maintainers:
Jiri Kosina, Benjamin Tissoires, Linus Torvalds
This is a preparation patch for not registering the driver on some machines where just trying to probe a non HID compliant device causes issues. Signed-off-by: Hans de Goede <redacted> --- drivers/hid/i2c-hid/i2c-hid.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index fb55fb4c39fc..54b53d8f96ce 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c@@ -1276,7 +1276,17 @@ static struct i2c_driver i2c_hid_driver = { .id_table = i2c_hid_id_table, }; -module_i2c_driver(i2c_hid_driver); +static int __init i2c_hid_init(void) +{ + return i2c_add_driver(&i2c_hid_driver); +} +module_init(i2c_hid_init); + +static void __exit i2c_hid_exit(void) +{ + i2c_del_driver(&i2c_hid_driver); +} +module_exit(i2c_hid_exit); MODULE_DESCRIPTION("HID over I2C core driver"); MODULE_AUTHOR("Benjamin Tissoires <benjamin.tissoires@gmail.com>");
--
2.13.0