summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-apple.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 6c52203cdbdf..8aa71750a23c 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -167,7 +167,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
167 struct hid_usage *usage, __s32 value) 167 struct hid_usage *usage, __s32 value)
168{ 168{
169 struct apple_sc *asc = hid_get_drvdata(hid); 169 struct apple_sc *asc = hid_get_drvdata(hid);
170 const struct apple_key_translation *trans; 170 const struct apple_key_translation *trans, *table;
171 171
172 if (usage->code == KEY_FN) { 172 if (usage->code == KEY_FN) {
173 asc->fn_on = !!value; 173 asc->fn_on = !!value;
@@ -178,14 +178,15 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
178 if (fnmode) { 178 if (fnmode) {
179 int do_translate; 179 int do_translate;
180 180
181 if(hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI && 181 if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
182 hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) { 182 hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
183 trans = apple_find_translation(macbookair_fn_keys, usage->code); 183 table = macbookair_fn_keys;
184 } else if (hid->product < 0x21d || hid->product >= 0x300) { 184 else if (hid->product < 0x21d || hid->product >= 0x300)
185 trans = apple_find_translation(powerbook_fn_keys, usage->code); 185 table = powerbook_fn_keys;
186 } else { 186 else
187 trans = apple_find_translation(apple_fn_keys, usage->code); 187 table = apple_fn_keys;
188 } 188
189 trans = apple_find_translation (table, usage->code);
189 190
190 if (trans) { 191 if (trans) {
191 if (test_bit(usage->code, asc->pressed_fn)) 192 if (test_bit(usage->code, asc->pressed_fn))