mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 12:00:58 +07:00
HID: uclogic: Do not initialize non-USB devices
Do not try to initialize UC-Logic tablets if the underlying device is not a USB device, but e.g. a uhid device. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
This commit is contained in:
parent
e902ed9344
commit
8547b7789c
@ -826,7 +826,8 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
|
||||
* uclogic_params_cleanup()). Not modified in case of error.
|
||||
* Cannot be NULL.
|
||||
* @hdev: The HID device of the tablet interface to initialize and get
|
||||
* parameters from. Cannot be NULL.
|
||||
* parameters from. Cannot be NULL. Must be using the USB low-level
|
||||
* driver, i.e. be an actual USB tablet.
|
||||
*
|
||||
* Returns:
|
||||
* Zero, if successful. A negative errno code on error.
|
||||
@ -844,7 +845,8 @@ int uclogic_params_init(struct uclogic_params *params,
|
||||
struct uclogic_params p = {0, };
|
||||
|
||||
/* Check arguments */
|
||||
if (params == NULL || hdev == NULL) {
|
||||
if (params == NULL || hdev == NULL ||
|
||||
!hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
|
||||
rc = -EINVAL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user