Re: [PATCH] HID: fix up .raw_event() documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 4, 2018 at 11:34 AM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:

> 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.

I noticed that there is a whole slew of drivers in the kernel
that actually return 1 from their .raw_event handlers.

drivers/hid/hid-alps.c
drivers/hid/hid-asus.c
drivers/hid/hid-cp2112.c
drivers/hid/hid-elan.c
drivers/hid/hid-elo.c
(...)

I suspect what they want is "no further event processing"
so it's a pretty weird legacy bug or something.

Should we patch them all one by one to return something like
-ENODATA or should we patch the library to actually
respect the return value 1 and skip further event processing
if that happens?

Yours,
Linus Walleij



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux