From: Hans de Goede <hdegoede@redhat.com>
To: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org
Subject: [PATCH 1/2] HID: i2c-hid: Expand module_i2c_driver macro
Date: Sun, 18 Jun 2017 12:14:47 +0200 [thread overview]
Message-ID: <20170618101448.17734-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20170618101448.17734-1-hdegoede@redhat.com>
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@redhat.com>
---
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
next prev parent reply other threads:[~2017-06-18 10:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-18 10:14 [PATCH 0/2] HID: i2c-hid: Do not register i2c_hid_driver on devices with a CHPN0001 touchscreen Hans de Goede
2017-06-18 10:14 ` Hans de Goede [this message]
2017-06-18 10:14 ` [PATCH 2/2] HID: i2c-hid: Do not register i2c_hid_driver on devices with " Hans de Goede
2017-06-27 12:26 ` [PATCH 0/2] HID: i2c-hid: Do not register i2c_hid_driver on devices with a " Jiri Kosina
2017-06-27 12:48 ` Benjamin Tissoires
2017-06-27 13:13 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170618101448.17734-2-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).