HID: wacom: fixup quirks setup for WACOM_DEVICETYPE_PAD
authorJiri Kosina <jkosina@suse.cz>
Mon, 16 Nov 2015 23:24:14 +0000 (00:24 +0100)
committerJiri Kosina <jkosina@suse.cz>
Mon, 16 Nov 2015 23:24:14 +0000 (00:24 +0100)
Given that INTUOSHT < BAMBOO_PT

features->type >= INTUOSHT || features->type <= BAMBOO_PT

condition is always true, and therefore device_type is under certain
circumstances wrongly set with WACOM_DEVICETYPE_PAD bit set.

Fix the condition so that it actually represents the range as intended.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_wac.c

index 0ff22dbe334c42cb26ce2798ef577902093be08e..01a4f05c16421b63a09737ad3eb4a4fb249259ae 100644 (file)
@@ -2481,7 +2481,7 @@ void wacom_setup_device_quirks(struct wacom *wacom)
                if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
                        if (features->touch_max)
                                features->device_type |= WACOM_DEVICETYPE_TOUCH;
-                       if (features->type >= INTUOSHT || features->type <= BAMBOO_PT)
+                       if (features->type >= INTUOSHT && features->type <= BAMBOO_PT)
                                features->device_type |= WACOM_DEVICETYPE_PAD;
 
                        features->x_max = 4096;