diff mbox

Check whether getkeycode and setkeycode are still valide

Message ID 20100322024811.GA25096@ywang-moblin2.bj.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yong Wang March 22, 2010, 2:48 a.m. UTC
None
diff mbox

Patch

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,