[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1452607380-20861-9-git-send-email-kernel@kempniu.pl>
Date: Tue, 12 Jan 2016 15:02:54 +0100
From: Michał Kępień <kernel@...pniu.pl>
To: Darren Hart <dvhart@...radead.org>,
Matthew Garrett <mjg59@...f.ucam.org>,
Pali Rohár <pali.rohar@...il.com>,
Richard Purdie <rpurdie@...ys.net>,
Jacek Anaszewski <j.anaszewski@...sung.com>
Cc: Alex Hung <alex.hung@...onical.com>,
platform-driver-x86@...r.kernel.org, linux-leds@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 08/14] dell-smbios: implement new function for finding DMI table 0xDA tokens
Ultimately, the da_tokens table should not be exported from dell-smbios.
Currently, in some cases, dell-laptop accesses that table's members
directly, so implement a new function, dell_smbios_find_token(), which
returns a pointer to an entry inside the da_tokens table with the given
token ID (or NULL if it is not found).
Signed-off-by: Michał Kępień <kernel@...pniu.pl>
---
drivers/platform/x86/dell-smbios.c | 13 +++++++++++++
drivers/platform/x86/dell-smbios.h | 2 ++
2 files changed, 15 insertions(+)
diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell-smbios.c
index 597a29f..83e35ed 100644
--- a/drivers/platform/x86/dell-smbios.c
+++ b/drivers/platform/x86/dell-smbios.c
@@ -59,6 +59,19 @@ void dell_smbios_release_buffer(void)
}
EXPORT_SYMBOL_GPL(dell_smbios_release_buffer);
+struct calling_interface_token *dell_smbios_find_token(int tokenid)
+{
+ int i;
+
+ for (i = 0; i < da_num_tokens; i++) {
+ if (da_tokens[i].tokenID == tokenid)
+ return &da_tokens[i];
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(dell_smbios_find_token);
+
int find_token_id(int tokenid)
{
int i;
diff --git a/drivers/platform/x86/dell-smbios.h b/drivers/platform/x86/dell-smbios.h
index 5ccc0ea..23f6e95 100644
--- a/drivers/platform/x86/dell-smbios.h
+++ b/drivers/platform/x86/dell-smbios.h
@@ -42,6 +42,8 @@ void dell_smbios_clear_buffer(void);
void dell_smbios_get_buffer(void);
void dell_smbios_release_buffer(void);
+struct calling_interface_token *dell_smbios_find_token(int tokenid);
+
int find_token_id(int tokenid);
int find_token_location(int tokenid);
--
1.7.10.4
Powered by blists - more mailing lists