From patchwork Tue Nov 18 21:27:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 5333351 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31704C11AC for ; Tue, 18 Nov 2014 21:28:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12B2C20125 for ; Tue, 18 Nov 2014 21:28:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8CD02010B for ; Tue, 18 Nov 2014 21:27:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932492AbaKRV15 (ORCPT ); Tue, 18 Nov 2014 16:27:57 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:39284 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932074AbaKRV14 (ORCPT ); Tue, 18 Nov 2014 16:27:56 -0500 Received: by mail-pa0-f45.google.com with SMTP id lj1so1177052pab.4 for ; Tue, 18 Nov 2014 13:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=YhmOBtoqjZlju0Pp0j1FLf4IzqvOwju99wlrIIYOywI=; b=aAQa0czKfcAmjYUovU5+/5U/xHVgkubWYI8eksRpSvMmTwDSiwqn4TdkKoMxfXjZqT x0tbkeQGYVPgf4Tno1M1UJG6HifL0/kev6lnPzDZVxKSGmw2vc3WXZD33TZo3FyDU34N 1VzLjMXp4jVsO4eqcrIhOoe86K36jnbK0eWSn58P59da90JVHNE6sRxs+xNmf405COAn 5DOYOfOM99Z+T/b+rp5QzZ/a66sg2BmI+a0SVYnwKffk2JUC5vlHjjxhNSeKJsNhaxIH xIGn2RS5K0ZJCszu2cHT7XWjMLiQ+VHQIh0mX//eKaVNLzUWqlJWbg8bfyLkgqAkQPRd btHA== X-Received: by 10.68.249.4 with SMTP id yq4mr37683612pbc.119.1416346076253; Tue, 18 Nov 2014 13:27:56 -0800 (PST) Received: from wacom-XPS-8500.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id sc9sm7621972pbc.85.2014.11.18.13.27.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Nov 2014 13:27:55 -0800 (PST) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, benjamin.tissoires@gmail.com, Ping Cheng Subject: [PATCH 1/3] HID: wacom - return ENODEV for failed wacom_setup_pad_input_capabilities Date: Tue, 18 Nov 2014 13:27:48 -0800 Message-Id: <1416346068-11266-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.9.1 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 ENODEV indicates no device is added. Hence, the associated pad input device is simply freed. Signed-off-by: Ping Cheng Reviewed-by: Benjamin Tissoires --- drivers/hid/wacom_wac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 586b240..372d890 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2402,7 +2402,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, case INTUOSPS: /* touch interface does not have the pad device */ if (features->device_type != BTN_TOOL_PEN) - return 1; + return -ENODEV; for (i = 0; i < 7; i++) __set_bit(BTN_0 + i, input_dev->keybit); @@ -2447,7 +2447,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, case BAMBOO_PT: /* pad device is on the touch interface */ if (features->device_type != BTN_TOOL_FINGER) - return 1; + return -ENODEV; __clear_bit(ABS_MISC, input_dev->absbit); @@ -2460,7 +2460,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, default: /* no pad supported */ - return 1; + return -ENODEV; } return 0; }