This patch removes code for handling LED input events from i2c_hid_
hidinput_input_event and call hidinput_led_output_report helper
instead.

In consequence, i2c-hid driver is now sending LED output
reports to device.

Signed-off-by: Andre Guedes <[email protected]>
---
 drivers/hid/i2c-hid/i2c-hid.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 67ab5b7..e4722d3 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -701,8 +701,6 @@ static int i2c_hid_hidinput_input_event(struct input_dev 
*dev,
                unsigned int type, unsigned int code, int value)
 {
        struct hid_device *hid = input_get_drvdata(dev);
-       struct hid_field *field;
-       int offset;
 
        if (type == EV_FF)
                return input_ff_event(dev, type, code, value);
@@ -710,14 +708,7 @@ static int i2c_hid_hidinput_input_event(struct input_dev 
*dev,
        if (type != EV_LED)
                return -1;
 
-       offset = hidinput_find_field(hid, type, code, &field);
-
-       if (offset == -1) {
-               hid_warn(dev, "event field not found\n");
-               return -1;
-       }
-
-       hid_set_field(field, offset, value);
+       hidinput_led_output_report(hid, code, value);
 
        return 0;
 }
-- 
1.8.0.1

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

Reply via email to