diff options
Diffstat (limited to 'drivers/platform/x86/intel-wmi-thunderbolt.c')
-rw-r--r-- | drivers/platform/x86/intel-wmi-thunderbolt.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c index c2257bd06f18..9ded8e2af312 100644 --- a/drivers/platform/x86/intel-wmi-thunderbolt.c +++ b/drivers/platform/x86/intel-wmi-thunderbolt.c | |||
@@ -1,16 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * WMI Thunderbolt driver | 3 | * WMI Thunderbolt driver |
3 | * | 4 | * |
4 | * Copyright (C) 2017 Dell Inc. All Rights Reserved. | 5 | * Copyright (C) 2017 Dell Inc. All Rights Reserved. |
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | 6 | */ |
15 | 7 | ||
16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
@@ -38,12 +30,16 @@ static ssize_t force_power_store(struct device *dev, | |||
38 | input.length = sizeof(u8); | 30 | input.length = sizeof(u8); |
39 | input.pointer = &mode; | 31 | input.pointer = &mode; |
40 | mode = hex_to_bin(buf[0]); | 32 | mode = hex_to_bin(buf[0]); |
33 | dev_dbg(dev, "force_power: storing %#x\n", mode); | ||
41 | if (mode == 0 || mode == 1) { | 34 | if (mode == 0 || mode == 1) { |
42 | status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1, | 35 | status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1, |
43 | &input, NULL); | 36 | &input, NULL); |
44 | if (ACPI_FAILURE(status)) | 37 | if (ACPI_FAILURE(status)) { |
38 | dev_dbg(dev, "force_power: failed to evaluate ACPI method\n"); | ||
45 | return -ENODEV; | 39 | return -ENODEV; |
40 | } | ||
46 | } else { | 41 | } else { |
42 | dev_dbg(dev, "force_power: unsupported mode\n"); | ||
47 | return -EINVAL; | 43 | return -EINVAL; |
48 | } | 44 | } |
49 | return count; | 45 | return count; |
@@ -95,4 +91,4 @@ module_wmi_driver(intel_wmi_thunderbolt_driver); | |||
95 | MODULE_ALIAS("wmi:" INTEL_WMI_THUNDERBOLT_GUID); | 91 | MODULE_ALIAS("wmi:" INTEL_WMI_THUNDERBOLT_GUID); |
96 | MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>"); | 92 | MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>"); |
97 | MODULE_DESCRIPTION("Intel WMI Thunderbolt force power driver"); | 93 | MODULE_DESCRIPTION("Intel WMI Thunderbolt force power driver"); |
98 | MODULE_LICENSE("GPL"); | 94 | MODULE_LICENSE("GPL v2"); |