diff options
author | Joe Perches <joe@perches.com> | 2011-03-29 18:21:47 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-05-27 12:35:51 -0400 |
commit | dd3c7f2308e91d6ecbe5cd8a3310bb49e47e1ae7 (patch) | |
tree | d1d2c3ebe1de7961a578c0f9b10bf3f97a58608c /drivers/platform | |
parent | f9dcf192ed527fbf2f3a8a3574006d1ae855100b (diff) |
msi-wmi: Use pr_fmt and pr_<level>
Added pr_fmt.
Removed now unused #define DRV_PFX
Convert dprintk to pr_debug.
Convert printks to pr_<level>.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/msi-wmi.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index d5419c9ec07a..c832e3356cd6 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c | |||
@@ -20,6 +20,7 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | 24 | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/input.h> | 26 | #include <linux/input.h> |
@@ -36,13 +37,10 @@ MODULE_ALIAS("wmi:551A1F84-FBDD-4125-91DB-3EA8F44F1D45"); | |||
36 | MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"); | 37 | MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"); |
37 | 38 | ||
38 | #define DRV_NAME "msi-wmi" | 39 | #define DRV_NAME "msi-wmi" |
39 | #define DRV_PFX DRV_NAME ": " | ||
40 | 40 | ||
41 | #define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45" | 41 | #define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45" |
42 | #define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2" | 42 | #define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2" |
43 | 43 | ||
44 | #define dprintk(msg...) pr_debug(DRV_PFX msg) | ||
45 | |||
46 | #define SCANCODE_BASE 0xD0 | 44 | #define SCANCODE_BASE 0xD0 |
47 | #define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE | 45 | #define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE |
48 | #define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1) | 46 | #define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1) |
@@ -78,7 +76,7 @@ static int msi_wmi_query_block(int instance, int *ret) | |||
78 | 76 | ||
79 | if (!obj || obj->type != ACPI_TYPE_INTEGER) { | 77 | if (!obj || obj->type != ACPI_TYPE_INTEGER) { |
80 | if (obj) { | 78 | if (obj) { |
81 | printk(KERN_ERR DRV_PFX "query block returned object " | 79 | pr_err("query block returned object " |
82 | "type: %d - buffer length:%d\n", obj->type, | 80 | "type: %d - buffer length:%d\n", obj->type, |
83 | obj->type == ACPI_TYPE_BUFFER ? | 81 | obj->type == ACPI_TYPE_BUFFER ? |
84 | obj->buffer.length : 0); | 82 | obj->buffer.length : 0); |
@@ -97,8 +95,8 @@ static int msi_wmi_set_block(int instance, int value) | |||
97 | 95 | ||
98 | struct acpi_buffer input = { sizeof(int), &value }; | 96 | struct acpi_buffer input = { sizeof(int), &value }; |
99 | 97 | ||
100 | dprintk("Going to set block of instance: %d - value: %d\n", | 98 | pr_debug("Going to set block of instance: %d - value: %d\n", |
101 | instance, value); | 99 | instance, value); |
102 | 100 | ||
103 | status = wmi_set_block(MSIWMI_BIOS_GUID, instance, &input); | 101 | status = wmi_set_block(MSIWMI_BIOS_GUID, instance, &input); |
104 | 102 | ||
@@ -112,20 +110,19 @@ static int bl_get(struct backlight_device *bd) | |||
112 | /* Instance 1 is "get backlight", cmp with DSDT */ | 110 | /* Instance 1 is "get backlight", cmp with DSDT */ |
113 | err = msi_wmi_query_block(1, &ret); | 111 | err = msi_wmi_query_block(1, &ret); |
114 | if (err) { | 112 | if (err) { |
115 | printk(KERN_ERR DRV_PFX "Could not query backlight: %d\n", err); | 113 | pr_err("Could not query backlight: %d\n", err); |
116 | return -EINVAL; | 114 | return -EINVAL; |
117 | } | 115 | } |
118 | dprintk("Get: Query block returned: %d\n", ret); | 116 | pr_debug("Get: Query block returned: %d\n", ret); |
119 | for (level = 0; level < ARRAY_SIZE(backlight_map); level++) { | 117 | for (level = 0; level < ARRAY_SIZE(backlight_map); level++) { |
120 | if (backlight_map[level] == ret) { | 118 | if (backlight_map[level] == ret) { |
121 | dprintk("Current backlight level: 0x%X - index: %d\n", | 119 | pr_debug("Current backlight level: 0x%X - index: %d\n", |
122 | backlight_map[level], level); | 120 | backlight_map[level], level); |
123 | break; | 121 | break; |
124 | } | 122 | } |
125 | } | 123 | } |
126 | if (level == ARRAY_SIZE(backlight_map)) { | 124 | if (level == ARRAY_SIZE(backlight_map)) { |
127 | printk(KERN_ERR DRV_PFX "get: Invalid brightness value: 0x%X\n", | 125 | pr_err("get: Invalid brightness value: 0x%X\n", ret); |
128 | ret); | ||
129 | return -EINVAL; | 126 | return -EINVAL; |
130 | } | 127 | } |
131 | return level; | 128 | return level; |
@@ -156,7 +153,7 @@ static void msi_wmi_notify(u32 value, void *context) | |||
156 | 153 | ||
157 | status = wmi_get_event_data(value, &response); | 154 | status = wmi_get_event_data(value, &response); |
158 | if (status != AE_OK) { | 155 | if (status != AE_OK) { |
159 | printk(KERN_INFO DRV_PFX "bad event status 0x%x\n", status); | 156 | pr_info("bad event status 0x%x\n", status); |
160 | return; | 157 | return; |
161 | } | 158 | } |
162 | 159 | ||
@@ -164,7 +161,7 @@ static void msi_wmi_notify(u32 value, void *context) | |||
164 | 161 | ||
165 | if (obj && obj->type == ACPI_TYPE_INTEGER) { | 162 | if (obj && obj->type == ACPI_TYPE_INTEGER) { |
166 | int eventcode = obj->integer.value; | 163 | int eventcode = obj->integer.value; |
167 | dprintk("Eventcode: 0x%x\n", eventcode); | 164 | pr_debug("Eventcode: 0x%x\n", eventcode); |
168 | key = sparse_keymap_entry_from_scancode(msi_wmi_input_dev, | 165 | key = sparse_keymap_entry_from_scancode(msi_wmi_input_dev, |
169 | eventcode); | 166 | eventcode); |
170 | if (key) { | 167 | if (key) { |
@@ -175,8 +172,8 @@ static void msi_wmi_notify(u32 value, void *context) | |||
175 | /* Ignore event if the same event happened in a 50 ms | 172 | /* Ignore event if the same event happened in a 50 ms |
176 | timeframe -> Key press may result in 10-20 GPEs */ | 173 | timeframe -> Key press may result in 10-20 GPEs */ |
177 | if (ktime_to_us(diff) < 1000 * 50) { | 174 | if (ktime_to_us(diff) < 1000 * 50) { |
178 | dprintk("Suppressed key event 0x%X - " | 175 | pr_debug("Suppressed key event 0x%X - " |
179 | "Last press was %lld us ago\n", | 176 | "Last press was %lld us ago\n", |
180 | key->code, ktime_to_us(diff)); | 177 | key->code, ktime_to_us(diff)); |
181 | return; | 178 | return; |
182 | } | 179 | } |
@@ -187,17 +184,16 @@ static void msi_wmi_notify(u32 value, void *context) | |||
187 | (!acpi_video_backlight_support() || | 184 | (!acpi_video_backlight_support() || |
188 | (key->code != MSI_WMI_BRIGHTNESSUP && | 185 | (key->code != MSI_WMI_BRIGHTNESSUP && |
189 | key->code != MSI_WMI_BRIGHTNESSDOWN))) { | 186 | key->code != MSI_WMI_BRIGHTNESSDOWN))) { |
190 | dprintk("Send key: 0x%X - " | 187 | pr_debug("Send key: 0x%X - " |
191 | "Input layer keycode: %d\n", key->code, | 188 | "Input layer keycode: %d\n", |
192 | key->keycode); | 189 | key->code, key->keycode); |
193 | sparse_keymap_report_entry(msi_wmi_input_dev, | 190 | sparse_keymap_report_entry(msi_wmi_input_dev, |
194 | key, 1, true); | 191 | key, 1, true); |
195 | } | 192 | } |
196 | } else | 193 | } else |
197 | printk(KERN_INFO "Unknown key pressed - %x\n", | 194 | pr_info("Unknown key pressed - %x\n", eventcode); |
198 | eventcode); | ||
199 | } else | 195 | } else |
200 | printk(KERN_INFO DRV_PFX "Unknown event received\n"); | 196 | pr_info("Unknown event received\n"); |
201 | kfree(response.pointer); | 197 | kfree(response.pointer); |
202 | } | 198 | } |
203 | 199 | ||
@@ -238,8 +234,7 @@ static int __init msi_wmi_init(void) | |||
238 | int err; | 234 | int err; |
239 | 235 | ||
240 | if (!wmi_has_guid(MSIWMI_EVENT_GUID)) { | 236 | if (!wmi_has_guid(MSIWMI_EVENT_GUID)) { |
241 | printk(KERN_ERR | 237 | pr_err("This machine doesn't have MSI-hotkeys through WMI\n"); |
242 | "This machine doesn't have MSI-hotkeys through WMI\n"); | ||
243 | return -ENODEV; | 238 | return -ENODEV; |
244 | } | 239 | } |
245 | err = wmi_install_notify_handler(MSIWMI_EVENT_GUID, | 240 | err = wmi_install_notify_handler(MSIWMI_EVENT_GUID, |
@@ -270,7 +265,7 @@ static int __init msi_wmi_init(void) | |||
270 | 265 | ||
271 | backlight->props.brightness = err; | 266 | backlight->props.brightness = err; |
272 | } | 267 | } |
273 | dprintk("Event handler installed\n"); | 268 | pr_debug("Event handler installed\n"); |
274 | 269 | ||
275 | return 0; | 270 | return 0; |
276 | 271 | ||