From patchwork Fri May 1 00:51:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 6307711 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 58F3E9F373 for ; Fri, 1 May 2015 00:52:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FA2520120 for ; Fri, 1 May 2015 00:52:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F1512011D for ; Fri, 1 May 2015 00:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751362AbbEAAwR (ORCPT ); Thu, 30 Apr 2015 20:52:17 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34622 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbbEAAwQ (ORCPT ); Thu, 30 Apr 2015 20:52:16 -0400 Received: by pacyx8 with SMTP id yx8so75994085pac.1; Thu, 30 Apr 2015 17:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=vr+JLHWLsBtYZBB2tnL7NsqDnTELgLqmkV981aN9kyE=; b=BMk4cHwQjNEQEuEQNhnQmP4HerZOoQ+SVKvR/K65X85xWJ6HpXD1KUhpwdiTfPGWp7 sR8Ge61/sEk0Sk/6AKy72igz411aHAZ1U+llIk+nOus5JWjaQjOWr4aRYOobRdw9ssTl jwJoTU57JkHrCFCE7gMQnOjtXfMaCgMsGTSB4Gffzo9IVp7jW46oIiMAYarsYT8NZlMa AnqMgDE+RuZgFKO+me0+K369WuqRQFManGhozeDqj7jyxmAP9u6NmC3g+m5+n+Gh2XzB CBWy+D946LVglIAzLx7RPb2yvD/mPHOcrhNZkI94PXblufJK/Mg0sxiuDs7mBgzAkY5o bBgQ== X-Received: by 10.70.98.145 with SMTP id ei17mr13279189pdb.92.1430441535820; Thu, 30 Apr 2015 17:52:15 -0700 (PDT) Received: from wacom-arch2.localdomain ([67.51.163.2]) by mx.google.com with ESMTPSA id kn7sm3296368pab.10.2015.04.30.17.52.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Apr 2015 17:52:14 -0700 (PDT) From: Jason Gerecke To: Jiri Kosina , Ping Cheng , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Gerecke , Jason Gerecke Subject: [PATCH 1/3] HID: wacom: Do not add suffix to name of devices with an unknown type Date: Thu, 30 Apr 2015 17:51:53 -0700 Message-Id: <1430441515-30122-1-git-send-email-killertofu@gmail.com> X-Mailer: git-send-email 2.3.5 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Ping Cheng for the whole set. Reviewed-by: Benjamin Tissoires --- drivers/hid/wacom_sys.c | 13 ++++++++----- 1 file 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,