aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2016-01-22 09:27:23 -0500
committerDarren Hart <dvhart@linux.intel.com>2016-03-23 13:05:42 -0400
commit63c4029bdfc220ec3a1fa9135f5db3bdcd93b502 (patch)
tree40c8e18836a9415b9b83b92fd769afc37879b5c0 /drivers/platform
parent96f7ef90cc373f805a38f2a3e96a8b1948706954 (diff)
dell-laptop: use dell_smbios_find_token() instead of find_token_id()
Replace all uses of find_token_id() with dell_smbios_find_token() to avoid directly accessing the da_tokens table. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/dell-laptop.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 5b200f29c55d..4d1694d972b1 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -1326,19 +1326,19 @@ static int kbd_set_state_safe(struct kbd_state *state, struct kbd_state *old)
1326static int kbd_set_token_bit(u8 bit) 1326static int kbd_set_token_bit(u8 bit)
1327{ 1327{
1328 struct calling_interface_buffer *buffer; 1328 struct calling_interface_buffer *buffer;
1329 int id; 1329 struct calling_interface_token *token;
1330 int ret; 1330 int ret;
1331 1331
1332 if (bit >= ARRAY_SIZE(kbd_tokens)) 1332 if (bit >= ARRAY_SIZE(kbd_tokens))
1333 return -EINVAL; 1333 return -EINVAL;
1334 1334
1335 id = find_token_id(kbd_tokens[bit]); 1335 token = dell_smbios_find_token(kbd_tokens[bit]);
1336 if (id == -1) 1336 if (!token)
1337 return -EINVAL; 1337 return -EINVAL;
1338 1338
1339 buffer = dell_smbios_get_buffer(); 1339 buffer = dell_smbios_get_buffer();
1340 buffer->input[0] = da_tokens[id].location; 1340 buffer->input[0] = token->location;
1341 buffer->input[1] = da_tokens[id].value; 1341 buffer->input[1] = token->value;
1342 dell_smbios_send_request(1, 0); 1342 dell_smbios_send_request(1, 0);
1343 ret = buffer->output[0]; 1343 ret = buffer->output[0];
1344 dell_smbios_release_buffer(); 1344 dell_smbios_release_buffer();
@@ -1349,19 +1349,19 @@ static int kbd_set_token_bit(u8 bit)
1349static int kbd_get_token_bit(u8 bit) 1349static int kbd_get_token_bit(u8 bit)
1350{ 1350{
1351 struct calling_interface_buffer *buffer; 1351 struct calling_interface_buffer *buffer;
1352 int id; 1352 struct calling_interface_token *token;
1353 int ret; 1353 int ret;
1354 int val; 1354 int val;
1355 1355
1356 if (bit >= ARRAY_SIZE(kbd_tokens)) 1356 if (bit >= ARRAY_SIZE(kbd_tokens))
1357 return -EINVAL; 1357 return -EINVAL;
1358 1358
1359 id = find_token_id(kbd_tokens[bit]); 1359 token = dell_smbios_find_token(kbd_tokens[bit]);
1360 if (id == -1) 1360 if (!token)
1361 return -EINVAL; 1361 return -EINVAL;
1362 1362
1363 buffer = dell_smbios_get_buffer(); 1363 buffer = dell_smbios_get_buffer();
1364 buffer->input[0] = da_tokens[id].location; 1364 buffer->input[0] = token->location;
1365 dell_smbios_send_request(0, 0); 1365 dell_smbios_send_request(0, 0);
1366 ret = buffer->output[0]; 1366 ret = buffer->output[0];
1367 val = buffer->output[1]; 1367 val = buffer->output[1];
@@ -1370,7 +1370,7 @@ static int kbd_get_token_bit(u8 bit)
1370 if (ret) 1370 if (ret)
1371 return dell_smi_error(ret); 1371 return dell_smi_error(ret);
1372 1372
1373 return (val == da_tokens[id].value); 1373 return (val == token->value);
1374} 1374}
1375 1375
1376static int kbd_get_first_active_token_bit(void) 1376static int kbd_get_first_active_token_bit(void)
@@ -1472,7 +1472,7 @@ static inline void kbd_init_tokens(void)
1472 int i; 1472 int i;
1473 1473
1474 for (i = 0; i < ARRAY_SIZE(kbd_tokens); ++i) 1474 for (i = 0; i < ARRAY_SIZE(kbd_tokens); ++i)
1475 if (find_token_id(kbd_tokens[i]) != -1) 1475 if (dell_smbios_find_token(kbd_tokens[i]))
1476 kbd_token_bits |= BIT(i); 1476 kbd_token_bits |= BIT(i);
1477} 1477}
1478 1478