Commit b9a218b7 authored by malattia@linux.it's avatar malattia@linux.it Committed by Len Brown

sony-laptop: Add debug macros also used by the sonypi reimplementation

Signed-off-by: default avatarMattia Dongili <malattia@linux.it>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 56b8756b
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#define LOG_PFX KERN_WARNING "sony-laptop: "
#define dprintk(msg...) do { \
if (debug) printk(KERN_WARNING LOG_PFX msg); \
} while (0)
#define SONY_NC_CLASS "sony" #define SONY_NC_CLASS "sony"
#define SONY_NC_HID "SNY5001" #define SONY_NC_HID "SNY5001"
#define SONY_NC_DRIVER_NAME "ACPI Sony Notebook Control Driver v0.4" #define SONY_NC_DRIVER_NAME "ACPI Sony Notebook Control Driver v0.4"
...@@ -43,8 +48,6 @@ ...@@ -43,8 +48,6 @@
0-based values */ 0-based values */
#define SONY_MAX_BRIGHTNESS 8 #define SONY_MAX_BRIGHTNESS 8
#define LOG_PFX KERN_WARNING "sony-laptop: "
MODULE_AUTHOR("Stelian Pop, Mattia Dongili"); MODULE_AUTHOR("Stelian Pop, Mattia Dongili");
MODULE_DESCRIPTION(SONY_NC_DRIVER_NAME); MODULE_DESCRIPTION(SONY_NC_DRIVER_NAME);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -368,8 +371,7 @@ static struct backlight_ops sony_backlight_ops = { ...@@ -368,8 +371,7 @@ static struct backlight_ops sony_backlight_ops = {
*/ */
static void sony_acpi_notify(acpi_handle handle, u32 event, void *data) static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
{ {
if (debug) dprintk("sony_acpi_notify, event: %d\n", event);
printk(LOG_PFX "sony_acpi_notify, event: %d\n", event);
acpi_bus_generate_event(sony_nc_acpi_device, 1, event); acpi_bus_generate_event(sony_nc_acpi_device, 1, event);
} }
...@@ -472,9 +474,8 @@ static int sony_nc_add(struct acpi_device *device) ...@@ -472,9 +474,8 @@ static int sony_nc_add(struct acpi_device *device)
if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle,
*item->acpiget, *item->acpiget,
&handle))) { &handle))) {
if (debug) dprintk("Found %s getter: %s\n",
printk(LOG_PFX "Found %s getter: %s\n", item->name, *item->acpiget);
item->name, *item->acpiget);
item->devattr.attr.mode |= S_IRUGO; item->devattr.attr.mode |= S_IRUGO;
break; break;
} }
...@@ -485,9 +486,8 @@ static int sony_nc_add(struct acpi_device *device) ...@@ -485,9 +486,8 @@ static int sony_nc_add(struct acpi_device *device)
if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle,
*item->acpiset, *item->acpiset,
&handle))) { &handle))) {
if (debug) dprintk("Found %s setter: %s\n",
printk(LOG_PFX "Found %s setter: %s\n", item->name, *item->acpiset);
item->name, *item->acpiset);
item->devattr.attr.mode |= S_IWUSR; item->devattr.attr.mode |= S_IWUSR;
break; break;
} }
......
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