Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1345770
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios |
| Date | 2016-02-29 14:00 +0100 |
| Message-ID | <r7vAC-38v-17@gated-at.bofh.it> (permalink) |
| References | <r2PgC-KD-5@gated-at.bofh.it> <r5BTP-11s-1@gated-at.bofh.it> <r5BTQ-11s-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wednesday 24 February 2016 08:20:11 Michał Kępień wrote:
> 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);
And... here what about inline vs EXPORT_SYMBOL function? Just asking...
--
Pali Rohár
pali.rohar@gmail.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 0/5] Process Dell Instant Launch hotkey on Vostro V131 and Inspiron M5110 Michał Kępień <kernel@kempniu.pl> - 2016-02-24 08:20 +0100
[PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Michał Kępień <kernel@kempniu.pl> - 2016-02-24 08:20 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 14:00 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Michał Kępień <kernel@kempniu.pl> - 2016-02-29 21:30 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 21:30 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Michał Kępień <kernel@kempniu.pl> - 2016-02-29 21:50 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Darren Hart <dvhart@infradead.org> - 2016-03-01 00:00 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Michał Kępień <kernel@kempniu.pl> - 2016-03-02 12:50 +0100
Re: [PATCH v4 1/5] dell-laptop: move dell_smi_error() to dell-smbios Pali Rohár <pali.rohar@gmail.com> - 2016-03-03 12:40 +0100
[PATCH v4 5/5] dell-wmi: support Dell Inspiron M5110 Michał Kępień <kernel@kempniu.pl> - 2016-02-24 08:20 +0100
Re: [PATCH v4 5/5] dell-wmi: support Dell Inspiron M5110 Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 14:10 +0100
[PATCH v4 3/5] dell-wmi: enable receiving WMI events on Dell Vostro V131 Michał Kępień <kernel@kempniu.pl> - 2016-02-24 08:20 +0100
Re: [PATCH v4 3/5] dell-wmi: enable receiving WMI events on Dell Vostro V131 Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 14:00 +0100
[PATCH v4 2/5] dell-smbios: rename dell_smi_error() to dell_smbios_error() Michał Kępień <kernel@kempniu.pl> - 2016-02-24 08:30 +0100
Re: [PATCH v4 2/5] dell-smbios: rename dell_smi_error() to dell_smbios_error() Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 14:00 +0100
[PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Michał Kępień <kernel@kempniu.pl> - 2016-02-24 08:30 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 14:10 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Michał Kępień <kernel@kempniu.pl> - 2016-02-29 21:40 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 21:40 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Michał Kępień <kernel@kempniu.pl> - 2016-02-29 21:50 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Pali Rohár <pali.rohar@gmail.com> - 2016-02-29 22:00 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Darren Hart <dvhart@infradead.org> - 2016-03-01 00:10 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Michał Kępień <kernel@kempniu.pl> - 2016-03-02 13:40 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Darren Hart <dvhart@infradead.org> - 2016-03-03 18:20 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Michał Kępień <kernel@kempniu.pl> - 2016-03-03 19:50 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Darren Hart <dvhart@infradead.org> - 2016-03-03 21:50 +0100
Re: [PATCH v4 4/5] dell-wmi: properly process Dell Instant Launch hotkey Darren Hart <dvhart@infradead.org> - 2016-03-01 00:10 +0100
csiph-web