summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-02-20 15:24:49 -0500
committerJiri Kosina <jkosina@suse.cz>2014-02-24 17:23:15 +0100
commit3c86726cfe38952f0366f86acfbbb025813ec1c2 (patch)
tree74192839f11f698ee74ea55b4c17717e4c1bffba /drivers/hid
parent2ebaebcf31096f83401c850393e93bc8f28db0e9 (diff)
downloadtalos-obmc-linux-3c86726cfe38952f0366f86acfbbb025813ec1c2.tar.gz
talos-obmc-linux-3c86726cfe38952f0366f86acfbbb025813ec1c2.zip
HID: make .raw_request mandatory
SET_REPORT and GET_REPORT are mandatory in the HID specification. Make the corresponding API in hid-core mandatory too, which removes the need to test against it in some various places. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-core.c11
-rw-r--r--drivers/hid/hid-input.c4
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index b6ae69711d2a..0b57babe3f9f 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1330,9 +1330,6 @@ void __hid_request(struct hid_device *hid, struct hid_report *report,
int ret;
int len;
- if (!hid->ll_driver->raw_request)
- return;
-
buf = hid_alloc_report_buf(report, GFP_KERNEL);
if (!buf)
return;
@@ -2472,6 +2469,14 @@ int hid_add_device(struct hid_device *hdev)
return -ENODEV;
/*
+ * Check for the mandatory transport channel.
+ */
+ if (!hdev->ll_driver->raw_request) {
+ hid_err(hdev, "transport driver missing .raw_request()\n");
+ return -EINVAL;
+ }
+
+ /*
* Read the device report descriptor once and use as template
* for the driver-specific modifications.
*/
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 310b96779e8e..f5aef792f13b 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1266,9 +1266,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
}
input_set_drvdata(input_dev, hid);
- if (hid->ll_driver->request || hid->ll_driver->output_report ||
- hid->ll_driver->raw_request)
- input_dev->event = hidinput_input_event;
+ input_dev->event = hidinput_input_event;
input_dev->open = hidinput_open;
input_dev->close = hidinput_close;
input_dev->setkeycode = hidinput_setkeycode;
OpenPOWER on IntegriCloud