From dcc47bec79421e0a75b48bab5c61778a98e81ce7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 18 Jun 2017 08:49:12 +0200 Subject: [PATCH v2 5/6] HID: i2c-hid: Expand module_i2c_driver macro 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 --- 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 "); -- 2.13.0