From patchwork Mon Mar 22 02:48:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wang X-Patchwork-Id: 87332 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2M2vNng013006 for ; Mon, 22 Mar 2010 02:57:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753814Ab0CVC5W (ORCPT ); Sun, 21 Mar 2010 22:57:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:61246 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753716Ab0CVC5W (ORCPT ); Sun, 21 Mar 2010 22:57:22 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 21 Mar 2010 19:54:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.51,285,1267430400"; d="scan'208";a="502420020" Received: from ywang-moblin2.bj.intel.com (HELO localhost) ([172.16.180.96]) by orsmga002.jf.intel.com with ESMTP; 21 Mar 2010 19:56:21 -0700 Date: Mon, 22 Mar 2010 10:48:11 +0800 From: Yong Wang To: Dmitry Torokhov Cc: linux-input@vger.kernel.org Subject: Re: [PATCH] Check whether getkeycode and setkeycode are still valide Message-ID: <20100322024811.GA25096@ywang-moblin2.bj.intel.com> References: <20100321025648.GA24497@ywang-moblin2.bj.intel.com> <20100321031149.GC29360@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100321031149.GC29360@core.coreip.homeip.net> User-Agent: Mutt/1.5.18 (2008-05-17) 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]); Mon, 22 Mar 2010 02:57:23 +0000 (UTC) diff --git a/drivers/input/input.c b/drivers/input/input.c index e2aad0a..18c1d0b 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -581,7 +581,7 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode) } } -static int input_default_getkeycode(struct input_dev *dev, +int input_default_getkeycode(struct input_dev *dev, unsigned int scancode, unsigned int *keycode) { @@ -595,8 +595,9 @@ static int input_default_getkeycode(struct input_dev *dev, return 0; } +EXPORT_SYMBOL(input_default_getkeycode); -static int input_default_setkeycode(struct input_dev *dev, +int input_default_setkeycode(struct input_dev *dev, unsigned int scancode, unsigned int keycode) { @@ -645,6 +646,7 @@ static int input_default_setkeycode(struct input_dev *dev, return 0; } +EXPORT_SYMBOL(input_default_setkeycode); /** * input_get_keycode - retrieve keycode currently mapped to a given scancode diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c index f64e004..2e30887 100644 --- a/drivers/input/sparse-keymap.c +++ b/drivers/input/sparse-keymap.c @@ -181,8 +181,8 @@ void sparse_keymap_free(struct input_dev *dev) kfree(dev->keycode); dev->keycode = NULL; dev->keycodemax = 0; - dev->getkeycode = NULL; - dev->setkeycode = NULL; + dev->getkeycode = input_default_getkeycode; + dev->setkeycode = input_default_setkeycode; } EXPORT_SYMBOL(sparse_keymap_free); diff --git a/include/linux/input.h b/include/linux/input.h index 7ed2251..873c250 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -1417,6 +1417,13 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); } +int input_default_getkeycode(struct input_dev *dev, + unsigned int scancode, + unsigned int *keycode); +int input_default_setkeycode(struct input_dev *dev, + unsigned int scancode, + unsigned int keycode); + int input_get_keycode(struct input_dev *dev, unsigned int scancode, unsigned int *keycode); int input_set_keycode(struct input_dev *dev,