From patchwork Sun Aug 22 13:46:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 122681 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7MDld0G015602 for ; Sun, 22 Aug 2010 13:47:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447Ab0HVNrT (ORCPT ); Sun, 22 Aug 2010 09:47:19 -0400 Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]:46965 "EHLO ch-smtp02.sth.basefarm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377Ab0HVNrT (ORCPT ); Sun, 22 Aug 2010 09:47:19 -0400 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:44511 helo=alnilam) by ch-smtp02.sth.basefarm.net with smtp (Exim 4.68) (envelope-from ) id 1OnAt9-00053j-9e; Sun, 22 Aug 2010 15:47:12 +0200 Received: by alnilam (sSMTP sendmail emulation); Sun, 22 Aug 2010 15:46:57 +0200 From: "Henrik Rydberg" To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: [PATCH 1/2] input: mt: Initialize slots to unused Date: Sun, 22 Aug 2010 15:46:49 +0200 Message-Id: <1282484809-8554-1-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.1 X-Originating-IP: 83.248.196.134 X-Scan-Result: No virus found in message 1OnAt9-00053j-9e. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1OnAt9-00053j-9e 390c654becaf956587d92262f2197469 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 22 Aug 2010 13:47:39 +0000 (UTC) diff --git a/drivers/input/input.c b/drivers/input/input.c index a9b025f..9325844 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1599,8 +1599,9 @@ EXPORT_SYMBOL(input_free_device); * @dev: input device supporting MT events and finger tracking * @num_slots: number of slots used by the device * - * This function allocates all necessary memory for MT slot handling - * in the input device, and adds ABS_MT_SLOT to the device capabilities. + * This function allocates all necessary memory for MT slot handling in the + * input device, and adds ABS_MT_SLOT to the device capabilities. All slots + * are initially unused with ABS_MT_TRACKING_ID == -1. */ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) { @@ -1613,6 +1614,8 @@ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) dev->mtsize = num_slots; input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); + while (num_slots--) + dev->mt[num_slots].abs[ABS_MT_TRACKING_ID - ABS_MT_FIRST] = -1; return 0; }