summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-uclogic-params.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2019-02-10 11:14:06 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-02-21 12:00:54 +0100
commit8547b7789c62f81350422d357fdf48bfe5d9932f (patch)
treeab2afeecc94325633bcf54979f2846c13845d865 /drivers/hid/hid-uclogic-params.c
parentHID: uclogic: Add support for Ugee G5 (diff)
downloadlinux-8547b7789c62f81350422d357fdf48bfe5d9932f.tar.xz
linux-8547b7789c62f81350422d357fdf48bfe5d9932f.zip
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>
Diffstat (limited to 'drivers/hid/hid-uclogic-params.c')
-rw-r--r--drivers/hid/hid-uclogic-params.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
index b582739a570a..7710d9f957da 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -826,7 +826,8 @@ cleanup:
* 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;
}