diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-02-10 12:58:50 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 08:54:20 -0500 |
commit | 649f94790314b502bc4e905e005d89c3b693d60a (patch) | |
tree | 9a72c81740de45af89e97013a89615ce34cb142e /drivers/hid/i2c-hid | |
parent | 9b5a9ae88573884224a26fda0e3eb6a6ec48686d (diff) |
HID: i2c-hid: use generic .request() implementation
Having our own .request() implementation does not give anything,
so use the generic binding.
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/i2c-hid')
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index b48f49d1f0dd..5308656eec2e 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
@@ -623,36 +623,6 @@ static int i2c_hid_raw_request(struct hid_device *hid, unsigned char reportnum, | |||
623 | } | 623 | } |
624 | } | 624 | } |
625 | 625 | ||
626 | static void i2c_hid_request(struct hid_device *hid, struct hid_report *rep, | ||
627 | int reqtype) | ||
628 | { | ||
629 | struct i2c_client *client = hid->driver_data; | ||
630 | char *buf; | ||
631 | int ret; | ||
632 | int len = i2c_hid_get_report_length(rep) - 2; | ||
633 | |||
634 | buf = kzalloc(len, GFP_KERNEL); | ||
635 | if (!buf) | ||
636 | return; | ||
637 | |||
638 | switch (reqtype) { | ||
639 | case HID_REQ_GET_REPORT: | ||
640 | ret = i2c_hid_get_raw_report(hid, rep->id, buf, len, rep->type); | ||
641 | if (ret < 0) | ||
642 | dev_err(&client->dev, "%s: unable to get report: %d\n", | ||
643 | __func__, ret); | ||
644 | else | ||
645 | hid_input_report(hid, rep->type, buf, ret, 0); | ||
646 | break; | ||
647 | case HID_REQ_SET_REPORT: | ||
648 | hid_output_report(rep, buf); | ||
649 | i2c_hid_output_raw_report(hid, buf, len, rep->type, true); | ||
650 | break; | ||
651 | } | ||
652 | |||
653 | kfree(buf); | ||
654 | } | ||
655 | |||
656 | static int i2c_hid_parse(struct hid_device *hid) | 626 | static int i2c_hid_parse(struct hid_device *hid) |
657 | { | 627 | { |
658 | struct i2c_client *client = hid->driver_data; | 628 | struct i2c_client *client = hid->driver_data; |
@@ -809,7 +779,6 @@ static struct hid_ll_driver i2c_hid_ll_driver = { | |||
809 | .open = i2c_hid_open, | 779 | .open = i2c_hid_open, |
810 | .close = i2c_hid_close, | 780 | .close = i2c_hid_close, |
811 | .power = i2c_hid_power, | 781 | .power = i2c_hid_power, |
812 | .request = i2c_hid_request, | ||
813 | .output_report = i2c_hid_output_report, | 782 | .output_report = i2c_hid_output_report, |
814 | .raw_request = i2c_hid_raw_request, | 783 | .raw_request = i2c_hid_raw_request, |
815 | }; | 784 | }; |