diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2018-11-04 11:32:47 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-11-06 13:59:08 +0100 |
commit | aa9b760cec2385ad408bb2e346c7f6dc1be69a79 (patch) | |
tree | 73ecac01e157aa816bfa29bfcdc883b33b1049fb | |
parent | 3fc202e81db70bf60beb9296eefd4e48d6304607 (diff) | |
download | linux-aa9b760cec2385ad408bb2e346c7f6dc1be69a79.tar.bz2 |
HID: fix up .raw_event() documentation
The documentation for the .raw_event() callback says that if the
driver return 1, there will be no further processing of the event,
but this is not true, the actual code in hid-core.c looks like this:
if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
ret = hdrv->raw_event(hid, report, data, size);
if (ret < 0)
goto unlock;
}
ret = hid_report_raw_event(hid, type, data, size, interrupt);
The only return value that has any effect on the processing is
a negative error.
Correct this as it seems to confuse people: I found bogus code in
the Razer out-of-tree driver attempting to return 1 here.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | include/linux/hid.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 2827b87590d8..387c70df6f29 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -722,8 +722,8 @@ struct hid_usage_id { * input will not be passed to raw_event unless hid_device_io_start is * called. * - * raw_event and event should return 0 on no action performed, 1 when no - * further processing should be done and negative on error + * raw_event and event should return negative on error, any other value will + * pass the event on to .event() typically return 0 for success. * * input_mapping shall return a negative value to completely ignore this usage * (e.g. doubled or invalid usage), zero to continue with parsing of this |