Commit b5a4223c authored by Joe Perches's avatar Joe Perches Committed by Matthew Garrett

hp-wmi: Convert printks to pr_<level>

Added pr_fmt and converted printks to pr_<level>.
Removed now unused PREFIX and UNIMPL #defines.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 611f5763
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); ...@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
#define HPWMI_HOTKEY_QUERY 0xc #define HPWMI_HOTKEY_QUERY 0xc
#define HPWMI_WIRELESS2_QUERY 0x1b #define HPWMI_WIRELESS2_QUERY 0x1b
#define PREFIX "HP WMI: "
#define UNIMP "Unimplemented "
enum hp_wmi_radio { enum hp_wmi_radio {
HPWMI_WIFI = 0, HPWMI_WIFI = 0,
HPWMI_BLUETOOTH = 1, HPWMI_BLUETOOTH = 1,
...@@ -228,9 +227,8 @@ static int hp_wmi_perform_query(int query, int write, void *buffer, ...@@ -228,9 +227,8 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,
if (bios_return->return_code) { if (bios_return->return_code) {
if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE) if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE)
printk(KERN_WARNING PREFIX "query 0x%x returned " pr_warn("query 0x%x returned error 0x%x\n",
"error 0x%x\n", query, bios_return->return_code);
query, bios_return->return_code);
kfree(obj); kfree(obj);
return bios_return->return_code; return bios_return->return_code;
} }
...@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void) ...@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void)
if (num >= state.count || if (num >= state.count ||
devstate->rfkill_id != rfkill2[i].id) { devstate->rfkill_id != rfkill2[i].id) {
printk(KERN_WARNING PREFIX "power configuration of " pr_warn("power configuration of the wireless devices unexpectedly changed\n");
"the wireless devices unexpectedly changed\n");
continue; continue;
} }
...@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context) ...@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context)
status = wmi_get_event_data(value, &response); status = wmi_get_event_data(value, &response);
if (status != AE_OK) { if (status != AE_OK) {
printk(KERN_INFO PREFIX "bad event status 0x%x\n", status); pr_info("bad event status 0x%x\n", status);
return; return;
} }
...@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context) ...@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context)
if (!obj) if (!obj)
return; return;
if (obj->type != ACPI_TYPE_BUFFER) { if (obj->type != ACPI_TYPE_BUFFER) {
printk(KERN_INFO "hp-wmi: Unknown response received %d\n", pr_info("Unknown response received %d\n", obj->type);
obj->type);
kfree(obj); kfree(obj);
return; return;
} }
...@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context) ...@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context)
event_id = *location; event_id = *location;
event_data = *(location + 2); event_data = *(location + 2);
} else { } else {
printk(KERN_INFO "hp-wmi: Unknown buffer length %d\n", pr_info("Unknown buffer length %d\n", obj->buffer.length);
obj->buffer.length);
kfree(obj); kfree(obj);
return; return;
} }
...@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context) ...@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context)
if (!sparse_keymap_report_event(hp_wmi_input_dev, if (!sparse_keymap_report_event(hp_wmi_input_dev,
key_code, 1, true)) key_code, 1, true))
printk(KERN_INFO PREFIX "Unknown key code - 0x%x\n", pr_info("Unknown key code - 0x%x\n", key_code);
key_code);
break; break;
case HPWMI_WIRELESS: case HPWMI_WIRELESS:
if (rfkill2_count) { if (rfkill2_count) {
...@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context) ...@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context)
hp_wmi_get_hw_state(HPWMI_WWAN)); hp_wmi_get_hw_state(HPWMI_WWAN));
break; break;
case HPWMI_CPU_BATTERY_THROTTLE: case HPWMI_CPU_BATTERY_THROTTLE:
printk(KERN_INFO PREFIX UNIMP "CPU throttle because of 3 Cell" pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n");
" battery event detected\n");
break; break;
case HPWMI_LOCK_SWITCH: case HPWMI_LOCK_SWITCH:
break; break;
default: default:
printk(KERN_INFO PREFIX "Unknown event_id - %d - 0x%x\n", pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
event_id, event_data);
break; break;
} }
} }
...@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) ...@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
return err; return err;
if (state.count > HPWMI_MAX_RFKILL2_DEVICES) { if (state.count > HPWMI_MAX_RFKILL2_DEVICES) {
printk(KERN_WARNING PREFIX "unable to parse 0x1b query output\n"); pr_warn("unable to parse 0x1b query output\n");
return -EINVAL; return -EINVAL;
} }
...@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) ...@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
name = "hp-wwan"; name = "hp-wwan";
break; break;
default: default:
printk(KERN_WARNING PREFIX "unknown device type 0x%x\n", pr_warn("unknown device type 0x%x\n",
state.device[i].radio_type); state.device[i].radio_type);
continue; continue;
} }
if (!state.device[i].vendor_id) { if (!state.device[i].vendor_id) {
printk(KERN_WARNING PREFIX "zero device %d while %d " pr_warn("zero device %d while %d reported\n",
"reported\n", i, state.count); i, state.count);
continue; continue;
} }
...@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) ...@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
IS_HWBLOCKED(state.device[i].power)); IS_HWBLOCKED(state.device[i].power));
if (!(state.device[i].power & HPWMI_POWER_BIOS)) if (!(state.device[i].power & HPWMI_POWER_BIOS))
printk(KERN_INFO PREFIX "device %s blocked by BIOS\n", pr_info("device %s blocked by BIOS\n", name);
name);
err = rfkill_register(rfkill); err = rfkill_register(rfkill);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment