Commit e2935abb authored by Hanjun Guo's avatar Hanjun Guo Committed by Rafael J. Wysocki

ACPI: glue: Clean up the printing messages

Remove the in house ACPI_GLUE_DEBUG and its related debug message
printing, using pr_debug() instead.

While at it, replace printk() with pr_* to simplify the code.
Signed-off-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent ad319565
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Copyright (c) 2005 Intel Corp. * Copyright (c) 2005 Intel Corp.
*/ */
#define pr_fmt(fmt) "ACPI: " fmt
#include <linux/acpi_iort.h> #include <linux/acpi_iort.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -19,17 +21,6 @@ ...@@ -19,17 +21,6 @@
#include "internal.h" #include "internal.h"
#define ACPI_GLUE_DEBUG 0
#if ACPI_GLUE_DEBUG
#define DBG(fmt, ...) \
printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...) \
do { \
if (0) \
printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__); \
} while (0)
#endif
static LIST_HEAD(bus_type_list); static LIST_HEAD(bus_type_list);
static DECLARE_RWSEM(bus_type_sem); static DECLARE_RWSEM(bus_type_sem);
...@@ -44,7 +35,7 @@ int register_acpi_bus_type(struct acpi_bus_type *type) ...@@ -44,7 +35,7 @@ int register_acpi_bus_type(struct acpi_bus_type *type)
down_write(&bus_type_sem); down_write(&bus_type_sem);
list_add_tail(&type->list, &bus_type_list); list_add_tail(&type->list, &bus_type_list);
up_write(&bus_type_sem); up_write(&bus_type_sem);
printk(KERN_INFO PREFIX "bus type %s registered\n", type->name); pr_info("bus type %s registered\n", type->name);
return 0; return 0;
} }
return -ENODEV; return -ENODEV;
...@@ -59,8 +50,7 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type) ...@@ -59,8 +50,7 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type)
down_write(&bus_type_sem); down_write(&bus_type_sem);
list_del_init(&type->list); list_del_init(&type->list);
up_write(&bus_type_sem); up_write(&bus_type_sem);
printk(KERN_INFO PREFIX "bus type %s unregistered\n", pr_info("bus type %s unregistered\n", type->name);
type->name);
return 0; return 0;
} }
return -ENODEV; return -ENODEV;
...@@ -307,7 +297,7 @@ static int acpi_device_notify(struct device *dev) ...@@ -307,7 +297,7 @@ static int acpi_device_notify(struct device *dev)
adev = type->find_companion(dev); adev = type->find_companion(dev);
if (!adev) { if (!adev) {
DBG("Unable to get handle for %s\n", dev_name(dev)); pr_debug("Unable to get handle for %s\n", dev_name(dev));
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
...@@ -328,16 +318,15 @@ static int acpi_device_notify(struct device *dev) ...@@ -328,16 +318,15 @@ static int acpi_device_notify(struct device *dev)
adev->handler->bind(dev); adev->handler->bind(dev);
out: out:
#if ACPI_GLUE_DEBUG
if (!ret) { if (!ret) {
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_get_name(ACPI_HANDLE(dev), ACPI_FULL_PATHNAME, &buffer); acpi_get_name(ACPI_HANDLE(dev), ACPI_FULL_PATHNAME, &buffer);
DBG("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer); pr_debug("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer);
kfree(buffer.pointer); kfree(buffer.pointer);
} else } else {
DBG("Device %s -> No ACPI support\n", dev_name(dev)); pr_debug("Device %s -> No ACPI support\n", dev_name(dev));
#endif }
return ret; return ret;
} }
......
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