[PATCH 1/2] HID: i2c-hid: Expand module_i2c_driver macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <hdegoede@xxxxxxxxxx>
---
 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@xxxxxxxxx>");
-- 
2.13.0

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



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux