From 3c86726cfe38952f0366f86acfbbb025813ec1c2 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 20 Feb 2014 15:24:49 -0500 Subject: 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 Reviewed-by: David Herrmann Signed-off-by: Jiri Kosina --- drivers/hid/hid-core.c | 11 ++++++++--- drivers/hid/hid-input.c | 4 +--- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b6ae697..0b57bab 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 310b967..f5aef79 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; -- cgit v1.1