Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1315024
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Michał Kępień <kernel@kempniu.pl> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 11/16] dell-laptop: use dell_smbios_find_token() instead of find_token_id() |
| Date | Fri, 22 Jan 2016 15:30:02 +0100 |
| Message-ID | <qTKSS-5dr-23@gated-at.bofh.it> (permalink) |
| References | <qTKSR-5dr-7@gated-at.bofh.it> |
| X-Original-To | Darren Hart <dvhart@infradead.org>, Matthew Garrett <mjg59@srcf.ucam.org>, Pali Rohár <pali.rohar@gmail.com>, Richard Purdie <rpurdie@rpsys.net>, Jacek Anaszewski <j.anaszewski@samsung.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=qH48Vx1kyp0tI9uH7kqBOigtmgAlgHWq04F043bZShQ=; b=vLTkKiXawurFeW+BglXL6GThB28s6/k+5r/jCQCmGifveqwmRiq5zcboa2LRCp1//H EZ2N6sP93FSGxj/JDj7LUZ77sYfZt3HMJXAj0bEGBfVenDyUaFO181q3H2qZ1hwU3Au8 RoEAT/rPJ/Y41up/Br7ueB92j3U3JqSMGmwRs= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=qH48Vx1kyp0tI9uH7kqBOigtmgAlgHWq04F043bZShQ=; b=b5f5lOfLjO2L+JTHS9OcI/mW9BBecZpr7pDMO4sa2v3Aqj55kwnly5gisRUaRJkc1w 01S+s2FSNBZCAXbXfBlF1DyvOdjS+q/JpOjn0qy8oOKqRMuYYpdhfsYruqud+rNHgUxD W9V+yRMJdLlFzCavVq/FlFZSGZAK8WjZ8DB7laHiZUodVlMb6r8lpQACGL1xPvzOcryr YeKV07FZn0bwzmH8Vz4fhURlYVh1o6+9rDJZG5zQ3ujVuWeKV4kqcZWNn4Z0NhgR55Xu uQ0tq6zG5lwjheg5cHgFGvaUKp6+dv41TaJgcsswpV5/ZTUFV7j9bfaWIehRGffKEQA+ ysiw== |
| X-Gm-Message-State | AG10YOQJhCaC0fbsH9+k72cnAya6VxBAkbT4SmFNUp4TKRZN8FpJkGtmS1tVgos8gz0WXg== |
| X-Received | by 10.25.26.68 with SMTP id a65mr1378039lfa.24.1453472874366; Fri, 22 Jan 2016 06:27:54 -0800 (PST) |
| X-Mailer | git-send-email 1.7.10.4 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 81 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Fri, 22 Jan 2016 15:27:23 +0100 |
| X-Original-Message-ID | <1453472848-3118-12-git-send-email-kernel@kempniu.pl> |
| X-Original-References | <1453472848-3118-1-git-send-email-kernel@kempniu.pl> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1315024 |
Show key headers only | View raw
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>
---
drivers/platform/x86/dell-laptop.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 5b200f2..4d1694d 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)
static int kbd_set_token_bit(u8 bit)
{
struct calling_interface_buffer *buffer;
- int id;
+ struct calling_interface_token *token;
int ret;
if (bit >= ARRAY_SIZE(kbd_tokens))
return -EINVAL;
- id = find_token_id(kbd_tokens[bit]);
- if (id == -1)
+ token = dell_smbios_find_token(kbd_tokens[bit]);
+ if (!token)
return -EINVAL;
buffer = dell_smbios_get_buffer();
- buffer->input[0] = da_tokens[id].location;
- buffer->input[1] = da_tokens[id].value;
+ buffer->input[0] = token->location;
+ buffer->input[1] = token->value;
dell_smbios_send_request(1, 0);
ret = buffer->output[0];
dell_smbios_release_buffer();
@@ -1349,19 +1349,19 @@ static int kbd_set_token_bit(u8 bit)
static int kbd_get_token_bit(u8 bit)
{
struct calling_interface_buffer *buffer;
- int id;
+ struct calling_interface_token *token;
int ret;
int val;
if (bit >= ARRAY_SIZE(kbd_tokens))
return -EINVAL;
- id = find_token_id(kbd_tokens[bit]);
- if (id == -1)
+ token = dell_smbios_find_token(kbd_tokens[bit]);
+ if (!token)
return -EINVAL;
buffer = dell_smbios_get_buffer();
- buffer->input[0] = da_tokens[id].location;
+ buffer->input[0] = token->location;
dell_smbios_send_request(0, 0);
ret = buffer->output[0];
val = buffer->output[1];
@@ -1370,7 +1370,7 @@ static int kbd_get_token_bit(u8 bit)
if (ret)
return dell_smi_error(ret);
- return (val == da_tokens[id].value);
+ return (val == token->value);
}
static int kbd_get_first_active_token_bit(void)
@@ -1472,7 +1472,7 @@ static inline void kbd_init_tokens(void)
int i;
for (i = 0; i < ARRAY_SIZE(kbd_tokens); ++i)
- if (find_token_id(kbd_tokens[i]) != -1)
+ if (dell_smbios_find_token(kbd_tokens[i]))
kbd_token_bits |= BIT(i);
}
--
1.7.10.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v2 11/16] dell-laptop: use dell_smbios_find_token() instead of find_token_id() Michał Kępień <kernel@kempniu.pl> - 2016-01-22 15:30 +0100
csiph-web