summaryrefslogtreecommitdiffstats
path: root/drivers/hid/wacom_sys.c
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2015-04-30 17:51:53 -0700
committerJiri Kosina <jkosina@suse.cz>2015-05-04 10:00:22 +0200
commit8d80f790ecbcd0c3d55be51d867cbe4db1debd89 (patch)
treee2a724827fdbd13ed066d5c06917f3e481daf90e /drivers/hid/wacom_sys.c
parentc24eab4e0e449845ba98e649b0605ab0450193db (diff)
downloadop-kernel-dev-8d80f790ecbcd0c3d55be51d867cbe4db1debd89.zip
op-kernel-dev-8d80f790ecbcd0c3d55be51d867cbe4db1debd89.tar.gz
HID: wacom: Do not add suffix to name of devices with an unknown type
The naming logic currently assumes that all devices will be a pen, finger, or pad. Though this has historically been the case, the new HID_GENERIC catch-all may cause us to probe devices with Wacom's 056A VID which aren't any of these types (e.g. the "Cintiq 24HDT Monitor Control"). This patch updates the logic so that no suffix will be added to the device name if the device type is unknown. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r--drivers/hid/wacom_sys.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 9c57ac0..222baf5 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1440,12 +1440,15 @@ static void wacom_update_name(struct wacom *wacom)
snprintf(wacom_wac->pad_name, sizeof(wacom_wac->pad_name),
"%s Pad", wacom_wac->name);
- if (features->device_type != BTN_TOOL_FINGER)
+ if (features->device_type == BTN_TOOL_PEN) {
strlcat(wacom_wac->name, " Pen", WACOM_NAME_MAX);
- else if (features->touch_max)
- strlcat(wacom_wac->name, " Finger", WACOM_NAME_MAX);
- else
- strlcat(wacom_wac->name, " Pad", WACOM_NAME_MAX);
+ }
+ else if (features->device_type == BTN_TOOL_FINGER) {
+ if (features->touch_max)
+ strlcat(wacom_wac->name, " Finger", WACOM_NAME_MAX);
+ else
+ strlcat(wacom_wac->name, " Pad", WACOM_NAME_MAX);
+ }
}
static int wacom_probe(struct hid_device *hdev,
OpenPOWER on IntegriCloud