Having error: -22 while developing usb hid device

507 views Asked by At

Hello we're trying to get an usb-hid device working on linux system.(Currently Rpi-2B Buildroot 64bit)

But dmesg shows an error on device plugged in, while other keyboards/mouse work fine.

The error -22 isn't found with googling so I am stucking here.

Wondering what the code means or where to find the full error list. Or what our hw team can do to fix this.

Error Image

Does anyone can help? Thanks in advance.

1

There are 1 answers

0
DJm00n On

-22 is EINVAL defined as:

#define EINVAL      22  /* Invalid argument */

(usb subsystem returns negative error codes)

This error text comes from these lines:

ret = hid_add_device(hid);
if (ret) {
    hid_err(hid, "can't add hid device: %d\n", ret);
    goto err_connection_disable;
}

You can try to increase linux kernel loglevel to find the exact cause.