Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335491

[PATCH v3 1/5] dell-laptop: move dell_smi_error() to dell-smbios

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Michał Kępień <kernel@kempniu.pl>
Newsgroups linux.kernel
Subject [PATCH v3 1/5] dell-laptop: move dell_smi_error() to dell-smbios
Date Tue, 16 Feb 2016 16:00:03 +0100
Message-ID <r2PgD-KD-41@gated-at.bofh.it> (permalink)
References <qTjpE-39M-21@gated-at.bofh.it> <r2PgC-KD-5@gated-at.bofh.it>
X-Original-To Matthew Garrett <mjg59@srcf.ucam.org>, Pali Rohár <pali.rohar@gmail.com>, Darren Hart <dvhart@infradead.org>
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=voGPaqYY2KiiCAuqBAAB9RHaVsM75C+kyrFlTjKITyk=; b=ohgIWZJNywOjimqLx58hytY6O7CD+AKjCT1uNTbqEgF7n46SWFFCYCojuHK0Ub2qjE rejt+qofAp10aKZZEtfkX+vHggBjHOsBiQgCIEaBMnLGVyBfv2OAfjksA1tI4BTJ2SIT 73274M3LnPQwKua3Sy/lWBAOdSGSP4dc/5jYQ=
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=voGPaqYY2KiiCAuqBAAB9RHaVsM75C+kyrFlTjKITyk=; b=KX2ZZF5CTjMsL/KtbYZAOWc4hAzjJ0TpcTazAtONaI715jsXZPAqysFmb1SlMU/Q4Q BrUcgdxS4tfOAGlv4jQDPNk3sV03iIzsHCYZ+ELs8qCdcdFcLh5P2bRTU1X6w+PzRg22 I93JN8mIXg9RbWpC4k4HNR8CXRax+XR1Yrn3EJfHealWfP3lpq8HuCBmpDemS5zxevwT QvNPsr08gnVja9DxXcNMMAzo4Md7AlofbqeOaUO4M2bvq/dTRuH2yjltvDb63dibcIek elktmHKrVdQg3HCCKWmjPVN3nNNq8YTr1MYNwVtEVPRbck9plmHLBqEcugC0zVdpuYa1 wpLw==
X-Gm-Message-State AG10YORn3Ycfe3K49PW3znkhrfMUZz14xjywHP2KKhMra5EOP7nH0vayl27bytCgHZySCA==
X-Received by 10.25.24.68 with SMTP id o65mr8196754lfi.156.1455634254658; Tue, 16 Feb 2016 06:50: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 85
Organization linux.* mail to news gateway
X-Original-Cc Darek Stojaczyk <darek.stojaczyk@gmail.com>, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Tue, 16 Feb 2016 15:50:26 +0100
X-Original-Message-ID <1455634230-1487-2-git-send-email-kernel@kempniu.pl>
X-Original-References <20160121090401.GR7192@pali> <1455634230-1487-1-git-send-email-kernel@kempniu.pl>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1335491

Show key headers only | View raw


The dell_smi_error() method could be used by modules other than
dell-laptop for convenient translation of SMBIOS request errors into
errno values.  Thus, move it to dell-smbios.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
 drivers/platform/x86/dell-laptop.c |   14 --------------
 drivers/platform/x86/dell-smbios.c |   16 ++++++++++++++++
 drivers/platform/x86/dell-smbios.h |    2 ++
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 76064c8..cbafb95 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -273,20 +273,6 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
 	{ }
 };
 
-static inline int dell_smi_error(int value)
-{
-	switch (value) {
-	case 0: /* Completed successfully */
-		return 0;
-	case -1: /* Completed with error */
-		return -EIO;
-	case -2: /* Function not supported */
-		return -ENXIO;
-	default: /* Unknown error */
-		return -EINVAL;
-	}
-}
-
 /*
  * Derived from information in smbios-wireless-ctl:
  *
diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell-smbios.c
index 2a4992a..942572f 100644
--- a/drivers/platform/x86/dell-smbios.c
+++ b/drivers/platform/x86/dell-smbios.c
@@ -16,6 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/dmi.h>
+#include <linux/err.h>
 #include <linux/gfp.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
@@ -39,6 +40,21 @@ static int da_command_code;
 static int da_num_tokens;
 static struct calling_interface_token *da_tokens;
 
+int dell_smi_error(int value)
+{
+	switch (value) {
+	case 0: /* Completed successfully */
+		return 0;
+	case -1: /* Completed with error */
+		return -EIO;
+	case -2: /* Function not supported */
+		return -ENXIO;
+	default: /* Unknown error */
+		return -EINVAL;
+	}
+}
+EXPORT_SYMBOL_GPL(dell_smi_error);
+
 struct calling_interface_buffer *dell_smbios_get_buffer(void)
 {
 	mutex_lock(&buffer_mutex);
diff --git a/drivers/platform/x86/dell-smbios.h b/drivers/platform/x86/dell-smbios.h
index 4f69b16..52febe6 100644
--- a/drivers/platform/x86/dell-smbios.h
+++ b/drivers/platform/x86/dell-smbios.h
@@ -35,6 +35,8 @@ struct calling_interface_token {
 	};
 };
 
+int dell_smi_error(int value);
+
 struct calling_interface_buffer *dell_smbios_get_buffer(void);
 void dell_smbios_clear_buffer(void);
 void dell_smbios_release_buffer(void);
-- 
1.7.10.4

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/5] Process Dell Instant Launch hotkey on Vostro V131 and Inspiron M5110 Michał Kępień <kernel@kempniu.pl> - 2016-02-16 16:00 +0100
  [PATCH v3 2/5] dell-smbios: rename dell_smi_error() to dell_smbios_error() Michał Kępień <kernel@kempniu.pl> - 2016-02-16 16:00 +0100
  [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2016-02-16 16:00 +0100
    Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Pali Rohár <pali.rohar@gmail.com> - 2016-02-16 16:20 +0100
      Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2016-02-16 23:00 +0100
    Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Darren Hart <dvhart@infradead.org> - 2016-02-20 02:30 +0100
      Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2016-02-22 10:00 +0100
        Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Pali Rohár <pali.rohar@gmail.com> - 2016-02-22 10:10 +0100
          Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2016-02-22 10:40 +0100
        Re: [PATCH v3 3/5] dell-wmi: enable receiving WMI events on Dell  Vostro V131 Darren Hart <dvhart@infradead.org> - 2016-02-22 22:20 +0100
  [PATCH v3 1/5] dell-laptop: move dell_smi_error() to dell-smbios Michał Kępień <kernel@kempniu.pl> - 2016-02-16 16:00 +0100

csiph-web