Commit 19b53289 authored by Joe Perches's avatar Joe Perches Committed by Len Brown

eeepc-laptop.c: use pr_fmt and pr_<level>

Convert the unusual printk(EEEPC_<level> uses to
the more standard pr_fmt and pr_<level>(.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarCorentin Chary <corentincj@iksaif.net>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 2b121bc2
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#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>
...@@ -41,11 +43,6 @@ ...@@ -41,11 +43,6 @@
#define EEEPC_HOTK_DEVICE_NAME "Hotkey" #define EEEPC_HOTK_DEVICE_NAME "Hotkey"
#define EEEPC_HOTK_HID "ASUS010" #define EEEPC_HOTK_HID "ASUS010"
#define EEEPC_LOG EEEPC_HOTK_FILE ": "
#define EEEPC_ERR KERN_ERR EEEPC_LOG
#define EEEPC_WARNING KERN_WARNING EEEPC_LOG
#define EEEPC_NOTICE KERN_NOTICE EEEPC_LOG
#define EEEPC_INFO KERN_INFO EEEPC_LOG
/* /*
* Definitions for Asus EeePC * Definitions for Asus EeePC
...@@ -285,7 +282,7 @@ static int set_acpi(int cm, int value) ...@@ -285,7 +282,7 @@ static int set_acpi(int cm, int value)
if (method == NULL) if (method == NULL)
return -ENODEV; return -ENODEV;
if (write_acpi_int(ehotk->handle, method, value, NULL)) if (write_acpi_int(ehotk->handle, method, value, NULL))
printk(EEEPC_WARNING "Error writing %s\n", method); pr_warning("Error writing %s\n", method);
} }
return 0; return 0;
} }
...@@ -298,7 +295,7 @@ static int get_acpi(int cm) ...@@ -298,7 +295,7 @@ static int get_acpi(int cm)
if (method == NULL) if (method == NULL)
return -ENODEV; return -ENODEV;
if (read_acpi_int(ehotk->handle, method, &value)) if (read_acpi_int(ehotk->handle, method, &value))
printk(EEEPC_WARNING "Error reading %s\n", method); pr_warning("Error reading %s\n", method);
} }
return value; return value;
} }
...@@ -562,26 +559,23 @@ static int eeepc_hotk_check(void) ...@@ -562,26 +559,23 @@ static int eeepc_hotk_check(void)
if (ehotk->device->status.present) { if (ehotk->device->status.present) {
if (write_acpi_int(ehotk->handle, "INIT", ehotk->init_flag, if (write_acpi_int(ehotk->handle, "INIT", ehotk->init_flag,
&buffer)) { &buffer)) {
printk(EEEPC_ERR "Hotkey initialization failed\n"); pr_err("Hotkey initialization failed\n");
return -ENODEV; return -ENODEV;
} else { } else {
printk(EEEPC_NOTICE "Hotkey init flags 0x%x\n", pr_notice("Hotkey init flags 0x%x\n", ehotk->init_flag);
ehotk->init_flag);
} }
/* get control methods supported */ /* get control methods supported */
if (read_acpi_int(ehotk->handle, "CMSG" if (read_acpi_int(ehotk->handle, "CMSG"
, &ehotk->cm_supported)) { , &ehotk->cm_supported)) {
printk(EEEPC_ERR pr_err("Get control methods supported failed\n");
"Get control methods supported failed\n");
return -ENODEV; return -ENODEV;
} else { } else {
printk(EEEPC_INFO pr_info("Get control methods supported: 0x%x\n",
"Get control methods supported: 0x%x\n", ehotk->cm_supported);
ehotk->cm_supported);
} }
ehotk->inputdev = input_allocate_device(); ehotk->inputdev = input_allocate_device();
if (!ehotk->inputdev) { if (!ehotk->inputdev) {
printk(EEEPC_INFO "Unable to allocate input device\n"); pr_info("Unable to allocate input device\n");
return 0; return 0;
} }
ehotk->inputdev->name = "Asus EeePC extra buttons"; ehotk->inputdev->name = "Asus EeePC extra buttons";
...@@ -600,12 +594,12 @@ static int eeepc_hotk_check(void) ...@@ -600,12 +594,12 @@ static int eeepc_hotk_check(void)
} }
result = input_register_device(ehotk->inputdev); result = input_register_device(ehotk->inputdev);
if (result) { if (result) {
printk(EEEPC_INFO "Unable to register input device\n"); pr_info("Unable to register input device\n");
input_free_device(ehotk->inputdev); input_free_device(ehotk->inputdev);
return 0; return 0;
} }
} else { } else {
printk(EEEPC_ERR "Hotkey device not present, aborting\n"); pr_err("Hotkey device not present, aborting\n");
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
...@@ -643,7 +637,7 @@ static void eeepc_rfkill_hotplug(void) ...@@ -643,7 +637,7 @@ static void eeepc_rfkill_hotplug(void)
bool blocked; bool blocked;
if (!bus) { if (!bus) {
printk(EEEPC_WARNING "Unable to find PCI bus 1?\n"); pr_warning("Unable to find PCI bus 1?\n");
return; return;
} }
...@@ -659,7 +653,7 @@ static void eeepc_rfkill_hotplug(void) ...@@ -659,7 +653,7 @@ static void eeepc_rfkill_hotplug(void)
if (dev) { if (dev) {
pci_bus_assign_resources(bus); pci_bus_assign_resources(bus);
if (pci_bus_add_device(dev)) if (pci_bus_add_device(dev))
printk(EEEPC_ERR "Unable to hotplug wifi\n"); pr_err("Unable to hotplug wifi\n");
} }
} else { } else {
dev = pci_get_slot(bus, 0); dev = pci_get_slot(bus, 0);
...@@ -742,8 +736,7 @@ static int eeepc_register_rfkill_notifier(char *node) ...@@ -742,8 +736,7 @@ static int eeepc_register_rfkill_notifier(char *node)
eeepc_rfkill_notify, eeepc_rfkill_notify,
NULL); NULL);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
printk(EEEPC_WARNING pr_warning("Failed to register notify on %s\n", node);
"Failed to register notify on %s\n", node);
} else } else
return -ENODEV; return -ENODEV;
...@@ -762,8 +755,7 @@ static void eeepc_unregister_rfkill_notifier(char *node) ...@@ -762,8 +755,7 @@ static void eeepc_unregister_rfkill_notifier(char *node)
ACPI_SYSTEM_NOTIFY, ACPI_SYSTEM_NOTIFY,
eeepc_rfkill_notify); eeepc_rfkill_notify);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
printk(EEEPC_ERR pr_err("Error removing rfkill notify handler %s\n",
"Error removing rfkill notify handler %s\n",
node); node);
} }
} }
...@@ -780,7 +772,7 @@ static int eeepc_setup_pci_hotplug(void) ...@@ -780,7 +772,7 @@ static int eeepc_setup_pci_hotplug(void)
struct pci_bus *bus = pci_find_bus(0, 1); struct pci_bus *bus = pci_find_bus(0, 1);
if (!bus) { if (!bus) {
printk(EEEPC_ERR "Unable to find wifi PCI bus\n"); pr_err("Unable to find wifi PCI bus\n");
return -ENODEV; return -ENODEV;
} }
...@@ -801,7 +793,7 @@ static int eeepc_setup_pci_hotplug(void) ...@@ -801,7 +793,7 @@ static int eeepc_setup_pci_hotplug(void)
ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi"); ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
if (ret) { if (ret) {
printk(EEEPC_ERR "Unable to register hotplug slot - %d\n", ret); pr_err("Unable to register hotplug slot - %d\n", ret);
goto error_register; goto error_register;
} }
...@@ -822,7 +814,7 @@ static int eeepc_hotk_add(struct acpi_device *device) ...@@ -822,7 +814,7 @@ static int eeepc_hotk_add(struct acpi_device *device)
if (!device) if (!device)
return -EINVAL; return -EINVAL;
printk(EEEPC_NOTICE EEEPC_HOTK_NAME "\n"); pr_notice(EEEPC_HOTK_NAME "\n");
ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL); ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL);
if (!ehotk) if (!ehotk)
return -ENOMEM; return -ENOMEM;
...@@ -1105,8 +1097,7 @@ static int eeepc_backlight_init(struct device *dev) ...@@ -1105,8 +1097,7 @@ static int eeepc_backlight_init(struct device *dev)
bd = backlight_device_register(EEEPC_HOTK_FILE, dev, bd = backlight_device_register(EEEPC_HOTK_FILE, dev,
NULL, &eeepcbl_ops); NULL, &eeepcbl_ops);
if (IS_ERR(bd)) { if (IS_ERR(bd)) {
printk(EEEPC_ERR pr_err("Could not register eeepc backlight device\n");
"Could not register eeepc backlight device\n");
eeepc_backlight_device = NULL; eeepc_backlight_device = NULL;
return PTR_ERR(bd); return PTR_ERR(bd);
} }
...@@ -1125,8 +1116,7 @@ static int eeepc_hwmon_init(struct device *dev) ...@@ -1125,8 +1116,7 @@ static int eeepc_hwmon_init(struct device *dev)
hwmon = hwmon_device_register(dev); hwmon = hwmon_device_register(dev);
if (IS_ERR(hwmon)) { if (IS_ERR(hwmon)) {
printk(EEEPC_ERR pr_err("Could not register eeepc hwmon device\n");
"Could not register eeepc hwmon device\n");
eeepc_hwmon_device = NULL; eeepc_hwmon_device = NULL;
return PTR_ERR(hwmon); return PTR_ERR(hwmon);
} }
...@@ -1159,8 +1149,7 @@ static int __init eeepc_laptop_init(void) ...@@ -1159,8 +1149,7 @@ static int __init eeepc_laptop_init(void)
if (result) if (result)
goto fail_backlight; goto fail_backlight;
} else } else
printk(EEEPC_INFO "Backlight controlled by ACPI video " pr_info("Backlight controlled by ACPI video driver\n");
"driver\n");
result = eeepc_hwmon_init(dev); result = eeepc_hwmon_init(dev);
if (result) if (result)
......
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