From f3586d2f819af6dbe5b08d2a6f1d22b1a97e2b64 Mon Sep 17 00:00:00 2001 From: Ping Cheng Date: Fri, 20 Mar 2015 14:57:00 -0700 Subject: HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT The quirk was added for devices that support both pen and touch. It decides if a device supports multiple inputs by hardcoded feature type. However, for some devices, we do not know if they support both before accessing their HID descriptors. This patch relies on dynamically assigned device_type to make the decision. Also, we make it certain that wacom_wac->shared is always created. That is, the driver will not be loaded if it fails to create wacom_wac->shared. Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke Signed-off-by: Jiri Kosina --- drivers/hid/wacom_sys.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'drivers/hid/wacom_sys.c') diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 353fe476be26..1b00d8d4466c 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1521,19 +1521,17 @@ static int wacom_probe(struct hid_device *hdev, snprintf(wacom_wac->pad_name, sizeof(wacom_wac->pad_name), "%s Pad", features->name); - if (features->quirks & WACOM_QUIRK_MULTI_INPUT) { - /* Append the device type to the name */ - if (features->device_type != BTN_TOOL_FINGER) - 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); - - error = wacom_add_shared_data(hdev); - if (error) - goto fail_shared_data; - } + /* Append the device type to the name */ + if (features->device_type != BTN_TOOL_FINGER) + 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); + + error = wacom_add_shared_data(hdev); + if (error) + goto fail_shared_data; if (!(features->quirks & WACOM_QUIRK_MONITOR) && (features->quirks & WACOM_QUIRK_BATTERY)) { -- cgit v1.2.3