]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/platform/x86/topstar-laptop.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[net-next-2.6.git] / drivers / platform / x86 / topstar-laptop.c
index 02f3d4e9e666ddc127275d28a462388382fd7e1c..ff4b476f1950856f101959c7c1ccc6caa2e89b4a 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 #include <linux/acpi.h>
 #include <linux/input.h>
 
@@ -46,7 +47,7 @@ static struct tps_key_entry topstar_keymap[] = {
        { }
 };
 
-static struct tps_key_entry *tps_get_key_by_scancode(int code)
+static struct tps_key_entry *tps_get_key_by_scancode(unsigned int code)
 {
        struct tps_key_entry *key;
 
@@ -57,7 +58,7 @@ static struct tps_key_entry *tps_get_key_by_scancode(int code)
        return NULL;
 }
 
-static struct tps_key_entry *tps_get_key_by_keycode(int code)
+static struct tps_key_entry *tps_get_key_by_keycode(unsigned int code)
 {
        struct tps_key_entry *key;
 
@@ -126,7 +127,8 @@ static int acpi_topstar_fncx_switch(struct acpi_device *device, bool state)
        return 0;
 }
 
-static int topstar_getkeycode(struct input_dev *dev, int scancode, int *keycode)
+static int topstar_getkeycode(struct input_dev *dev,
+                               unsigned int scancode, unsigned int *keycode)
 {
        struct tps_key_entry *key = tps_get_key_by_scancode(scancode);
 
@@ -137,14 +139,12 @@ static int topstar_getkeycode(struct input_dev *dev, int scancode, int *keycode)
        return 0;
 }
 
-static int topstar_setkeycode(struct input_dev *dev, int scancode, int keycode)
+static int topstar_setkeycode(struct input_dev *dev,
+                               unsigned int scancode, unsigned int keycode)
 {
        struct tps_key_entry *key;
        int old_keycode;
 
-       if (keycode < 0 || keycode > KEY_MAX)
-               return -EINVAL;
-
        key = tps_get_key_by_scancode(scancode);
 
        if (!key)