aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sony-laptop.c
diff options
context:
space:
mode:
authormalattia@linux.it <malattia@linux.it>2007-04-09 04:19:06 -0400
committerLen Brown <len.brown@intel.com>2007-04-10 16:01:18 -0400
commitb9a218b738c5c2387f666731b81a4376021d681e (patch)
tree2b7bb69c6e956e99c5cae409c99e38341e90c30b /drivers/misc/sony-laptop.c
parent56b8756b3bc8812837a21f3e066dba1b489e071e (diff)
sony-laptop: Add debug macros also used by the sonypi reimplementation
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/sony-laptop.c')
-rw-r--r--drivers/misc/sony-laptop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 2d05d5b7e125..f4755370dd52 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -35,6 +35,11 @@
35#include <acpi/acpi_bus.h> 35#include <acpi/acpi_bus.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37 37
38#define LOG_PFX KERN_WARNING "sony-laptop: "
39#define dprintk(msg...) do { \
40 if (debug) printk(KERN_WARNING LOG_PFX msg); \
41} while (0)
42
38#define SONY_NC_CLASS "sony" 43#define SONY_NC_CLASS "sony"
39#define SONY_NC_HID "SNY5001" 44#define SONY_NC_HID "SNY5001"
40#define SONY_NC_DRIVER_NAME "ACPI Sony Notebook Control Driver v0.4" 45#define SONY_NC_DRIVER_NAME "ACPI Sony Notebook Control Driver v0.4"
@@ -43,8 +48,6 @@
43 0-based values */ 48 0-based values */
44#define SONY_MAX_BRIGHTNESS 8 49#define SONY_MAX_BRIGHTNESS 8
45 50
46#define LOG_PFX KERN_WARNING "sony-laptop: "
47
48MODULE_AUTHOR("Stelian Pop, Mattia Dongili"); 51MODULE_AUTHOR("Stelian Pop, Mattia Dongili");
49MODULE_DESCRIPTION(SONY_NC_DRIVER_NAME); 52MODULE_DESCRIPTION(SONY_NC_DRIVER_NAME);
50MODULE_LICENSE("GPL"); 53MODULE_LICENSE("GPL");
@@ -368,8 +371,7 @@ static struct backlight_ops sony_backlight_ops = {
368 */ 371 */
369static void sony_acpi_notify(acpi_handle handle, u32 event, void *data) 372static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
370{ 373{
371 if (debug) 374 dprintk("sony_acpi_notify, event: %d\n", event);
372 printk(LOG_PFX "sony_acpi_notify, event: %d\n", event);
373 acpi_bus_generate_event(sony_nc_acpi_device, 1, event); 375 acpi_bus_generate_event(sony_nc_acpi_device, 1, event);
374} 376}
375 377
@@ -472,9 +474,8 @@ static int sony_nc_add(struct acpi_device *device)
472 if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, 474 if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle,
473 *item->acpiget, 475 *item->acpiget,
474 &handle))) { 476 &handle))) {
475 if (debug) 477 dprintk("Found %s getter: %s\n",
476 printk(LOG_PFX "Found %s getter: %s\n", 478 item->name, *item->acpiget);
477 item->name, *item->acpiget);
478 item->devattr.attr.mode |= S_IRUGO; 479 item->devattr.attr.mode |= S_IRUGO;
479 break; 480 break;
480 } 481 }
@@ -485,9 +486,8 @@ static int sony_nc_add(struct acpi_device *device)
485 if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, 486 if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle,
486 *item->acpiset, 487 *item->acpiset,
487 &handle))) { 488 &handle))) {
488 if (debug) 489 dprintk("Found %s setter: %s\n",
489 printk(LOG_PFX "Found %s setter: %s\n", 490 item->name, *item->acpiset);
490 item->name, *item->acpiset);
491 item->devattr.attr.mode |= S_IWUSR; 491 item->devattr.attr.mode |= S_IWUSR;
492 break; 492 break;
493 } 493 }